now

Created: 2017 May 30th

Updated: 2020 Apr 18th

Edit this page on GitHub

The awesome now from zeit! It has a great cli with probably all of this detailed in there under -h somewhere 😁

Add a TXT record

Need to add a verification for something like the Google Search console.

now dns add yoursite.xyz '@' TXT someTextRecordYouNeedToAdd

Add a CNAME

now dns add yoursitename.com subdomainreference CNAME dnsprovider.org

Aliases

Got your own domain name? You can alias your latest now deployment

now alias now-generated-url.now.sh your-awesome-domain-name.af

Scale your deployment

Want your site to not get frozen? And have visitors have to wait for the instance to spin up?

This is straight from the CLI with now scale -h

# Create an deployment with 3 instances, never sleeps:
now scale my-deployment-ntahoeato.now.sh 3
# Create an automatically scaling deployment:
now scale my-deployment-ntahoeato.now.sh 1 5
# Create an automatically scaling deployment without specifying max:
now scale my-deployment-ntahoeato.now.sh 1 auto
# Create an automatically scaling deployment without specifying min or max:
now scale my-deployment-ntahoeato.now.sh auto
# Create an deployment that is always active and never "sleeps":
now scale my-deployment-ntahoeato.now.sh 1

Environment variables

Config stuff I always forget!

If it’s keys, then use secrets and configure them in the package.json:

 "now": {
    "alias": "cool",
    "env": {
      "AWS_ACCESS_KEY_ID": "@aws_access_key_id",
      "AWS_SECRET_ACCESS_KEY": "@aws_secret_access_key",
      "MONGODB_URI": "@mongodb_uri",
      "S3_BUCKET_NAME": "@s3_bucket_name",
      "SECRET": "@secret"
    }
  },

If you have a lot of configuration variables and you dont want to make a mess in the package.json:

now -E

That will pull your .env file and use that in place of adding individual vars via now -e var. I have always used dotenv and I understand that now uses dotenv for this and using without is untested by me?

Scott avatar

Made with ❤️ by Scott Spence

Copyright © 2024 - All right reserved