DEV Community

Discussion on: How to Deploy Express on Now.sh

Collapse
gfelot profile image
Gil • Edited

When you deploy your code with now-linux (never heard of now-linux but just now yes, I have to check), the terminal should output the URL... it even write it on the clipboard (the memory instance when you copy/paste) this URL.

Collapse
revskill10 profile image
Truong Hoang Dung

What i mean is to get instance url at runtime in your app

Thread Thread
warenix profile image
warenix Author • Edited

As @Gli said once you push code to now, intance url will be printed on console. Notice the line https://express-now-3b57ke4d4.now.sh is printed.

Sample output

❯ now-linux

Deploying ~/code/repo/github/express-now under XXXXXXX
Synced 2 files (929B) [1s]
https://express-now-3b57ke4d4.now.sh [v2] [in clipboard] [1s]
┌ index.js Ready [17s]
└── λ index.js (284.31KB) [sfo1]
Success! Deployment ready [19s]

Visit zeit.co/now here to see more details

Thread Thread
revskill10 profile image
Truong Hoang Dung

No no, what i mean is, inside my index.js code, i want to get the instance url like process.env.NOW_URL, like in Now V1.

Collapse
warenix profile image
warenix Author

I got the Linux cli here. You will use now if you installed via npm