简体   繁体   中英

Not able to load dynamic variables values in url in nodejs es6 string

My code is as shown below:

let urlString = https://${process.env.API_KEY}:${process.env.API_TOKEN}${process.env.SUBDOMAIN}/v1/Accounts/${process.env.ID}/Calls/connect

But somehow API_KEY, API_TOKEN, SUBDOMAIN and ID variables values are not getting added in the url

Did you set the backticks like this?

let urlString = `https://${process.env.API_KEY}:${process.env.API_TOKEN}${process.env.SUBDOMAIN}/v1/Accounts/${process.env.ID}/Calls/connect`;

I can't see them in your example.

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