# Zeit Now
Everything referenced here is about using Now V2.
There are 2 different ways to deploy.
- Using Now CLI
- Using a
now.json
file
# Important Commands
# Deploy
now --prod
# Secrets for env
variables
now --prod
# Universal Apps
The @nuxtjs/now-builder
can be used which is referenced in the Nuxt
docs.
I had to add the following to the project's package.json
file though.
{
"engines": {
"node": "10.x"
}
}
# Environmental Variables
# Step 1: Set The Secret Key
now secret api-key ApiKeyValue123
# Step 2: Setup env
variables in now.json
now.json
{
"version": 2,
"build": {
"env": {
"API_KEY": "@api_key"
}
}
}
# Step 3: Add this to nuxt.config.js
export default {
env: {
API_KEY: process.env.API_KEY
}
};
FYI
The format for using the secret via the NOW CLI
is as follows:
now secret add [name] [value]
The [value] is the secret value you are wanting to keep private.