Best answer

CLI Testing and Environment Variables

  • 7 March 2023
  • 3 replies
  • 63 views

Hey folks,

I am a noob at Node.js, so sorry if I am missing some obvious points. I converted my application from UI to CLI by using zapier convert command  without issues. However, I couldn’t manage to run tests.

I am getting “Only absolute URLs are supported” message after zapier test command. The message info goes on with the endpoint of my API: “{{process.env.API_URL}}/calculations/...”.

What should I do to resolve this issue? My UI version works flawlessly at the end. So, I don’t want to make changes like replacing variables with static values.

I have understood that I can get the variables from the .env file, but my .env doesn’t include a variable API_URL. It has only ACCESS_TOKEN and REFRESH_TOKEN. Also, I can’t access them if I wrapped them between curly brackets like the one above ({{process.env.API_URL}}).

Thanks in advance.

icon

Best answer by shalgrim 10 March 2023, 19:01

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 6
Badge +8

Hi @McManaman !

You can set environment variables with the following command:

zapier env:set [version_number] VARIABLE_NAME=variable_value

We have some documentation on this command here.

Let me know if you have any more questions!

Hi @McManaman !

You can set environment variables with the following command:

zapier env:set [version_number] VARIABLE_NAME=variable_value

We have some documentation on this command here.

Let me know if you have any more questions!

Hey shalgrim,

My question was how to test my app locally which is full with curlies “{{}}”?

Userlevel 6
Badge +8

Hm,

Have you tried adding API_URL to your .env file?