简体   繁体   中英

Environment Variables on Plesk Nodejs

I have hosted my node api on Plesk. But i cant find anywhere to add my env variables so that my api could work.

As you can see in the below image. custom variables option is below Application Startup File but in my case its not there.

在此处输入图像描述

(Plesk for Linux only) Custom environment variables - Here you can see a list of custom environment variables you have set for your application (if any). Click “[specify]” to add or remove environment variables for your application:

  • Click Add variable to add another environment variable to the list.
  • Type in the variable name in the left field, and its desired value in the right.
  • Edit the variables already on the list by clicking the corresponding field and typing in the new variable name or value.
  • Click Remove next to a variable to remove it from the list.

If you running Plesk on Linux env then the above option is available else you need to follow the below steps.

You need to use .env outside the application folder and create a custom script and pass these .env and send them as arguments when you run the node script. Check this link if it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM