This documents how to deploy a simple node app to https://zeit.co/now, set up alias, and configure environment variables. Check out this test site at https://muan-testing.now.sh.
-
Fork this repository or have your project ready with
npm startscript and these configurations in yourpackage.json. -
Get an account at https://zeit.co/login.
-
Install now CLI with
npm install now -g. -
Authenticate and deploy with
now --public. -
Set an environment variable with
now secrets [name] [value]. -
Alias deployment with
now ln. -
🎉.
Deploys your project and marks it as public. The --public flag prevents you from having to confirm that your project will be public.
"Public" means that people will be able to view your source code and logs via deployment_url/_logs. For example, https://muan-testing.now.sh/_logs.
Aliases your deployment.
Every deployment gets a new random URL like projectname-aicbqophhw.now.sh. This command aliases your latest deployment with the name set in package.json.
Expose your secret environment variables to your app in package.json. The @ before the variable name tells now to look for variable of that name in the secrets.