How to get now.sh instance url ?
now.sh
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.
now-linux
now
What i mean is to get instance url at runtime in your app
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.
https://express-now-3b57ke4d4.now.sh
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
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.
index.js
process.env.NOW_URL
I got the Linux cli here. You will use now if you installed via npm
npm
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
How to get
now.sh
instance url ?When you deploy your code with
now-linux
(never heard ofnow-linux
but justnow
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.What i mean is to get instance url at runtime in your app
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
Visit zeit.co/now here to see more details
No no, what i mean is, inside my
index.js
code, i want to get the instance url likeprocess.env.NOW_URL
, like in Now V1.I got the Linux cli here. You will use
now
if you installed vianpm