now alias my-api-xyz.now.sh my-new-domain.comnow alias my-api-xyz.now.sh my-new-custom-nameTo remove alias
now alias rm List all your secrets:
now secrets lsAdd a new secret:
now secrets add my-secret "my value"Once added, a secret's value can't be retrieved in plaintext anymore If the secret's value is more than one word, wrap it in quotes Actually, when in doubt, wrap your value in quotes
Expose a secret as an env variable:
now -e MY_SECRET=@my-secretNotice the @ symbol which makes the value a secret reference.
Rename a secret:
now secrets rename my-secret my-renamed-secretRemove a secret:
now secrets rm my-secretOnce you have created your secrets you can then use them in an npm script as part of your package.json:
"scripts": {
"start": "node index.js",
"deploy": "now -e CONSUMER_KEY=@consumerkey -e CONSUMER_SECRET=@consumersecret"
},This is assuming you have two secrets configured called consumerkey and consumersecret
If you have files ignored with .gitignore which you want to add to now you will need to include them in your package.json with the now setting:
"now": {
"alias": "alias-name",
"files": [
"src",
"index.js"
]
},You will also need to define in the .npmignore what you want including in the build, so say you want to include a *.csv files then:
!*.csv