Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
134 views
in Technique[技术] by (71.8m points)

node.js - How to start a Nodejs server with options?

My computer runs Windows10 Enterprise.

I found this repo for creating a Nodejs server for tchatbot. As you can see there are options for starting the server. I tried to execute this command : node app.js DF_PROJECT_ID="agent-human-handoff-sampl-jseo" DF_SERVICE_ACCOUNT_PATH="D:DocsTchatBotclé_account_service_agent_human_operatoragent-human-handoff-sampl-jseo-3349b2f01974.json"

But I got error : You need to specify a path to a service account keypair in environment variable DF_SERVICE_ACCOUNT_PATH

So what is wrong ?

question from:https://stackoverflow.com/questions/65949270/how-to-start-a-nodejs-server-with-options

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's basically same as jfriend00's solution, but I add node app.js in the end. And you just follow below sequence to run command.

set DF_SERVICE_ACCOUNT_PATH="D:DocsTchatBotclé_account_service_agent_human_operatoragent-human-handoff-sampl-jseo-3349b2f01974.json"
set DF_PROJECT_ID="agent-human-handoff-sampl-jseo"
node app.js

By the way, if you use linux system or macOS, you'll use following command to start server.

(Just one line) DF_SERVICE_ACCOUNT_PATH="D:DocsTchatBotclé_account_service_agent_human_operatoragent-human-handoff-sampl-jseo-3349b2f01974.json" DF_PROJECT_ID="agent-human-handoff-sampl-jseo" node app.js


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...