简体   繁体   English

Plesk Nodejs 上的环境变量

[英]Environment Variables on Plesk Nodejs

I have hosted my node api on Plesk.我在 Plesk 上托管了我的节点 api。 But i cant find anywhere to add my env variables so that my api could work.但是我找不到任何地方可以添加我的环境变量,这样我的 api 就可以工作了。

As you can see in the below image.如下图所示。 custom variables option is below Application Startup File but in my case its not there.自定义变量选项在Application Startup File下面,但在我的例子中它不在那里。

在此处输入图像描述

(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). (仅限 Plesk for Linux)自定义环境变量 - 在这里您可以看到您为应用程序设置的自定义环境变量列表(如果有)。 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.如果您在 Linux env 上运行 Plesk,则以上选项可用,否则您需要按照以下步骤操作。

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.您需要在应用程序文件夹外使用.env并创建自定义脚本并传递这些.env并在运行节点脚本时将它们作为 arguments 发送。 Check this link if it helps. 检查此链接是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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