Skip to main content
Best answer

CLI Testing and Environment Variables


McManaman

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.

Best answer by shalgrimBest answer by shalgrim

Hm,

Have you tried adding API_URL to your .env file?

View original
Did this topic help you find an answer to your question?
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

shalgrim
Forum|alt.badge.img+8
  • Zapier Staff
  • 406 replies
  • March 9, 2023

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!


McManaman
  • Author
  • Beginner
  • 1 reply
  • March 10, 2023
shalgrim wrote:

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 “{{}}”?


shalgrim
Forum|alt.badge.img+8
  • Zapier Staff
  • 406 replies
  • Answer
  • March 10, 2023

Hm,

Have you tried adding API_URL to your .env file?