Today I'd like to take some time and sum up the updated capabilities of Now and what's needed for properly handling the process of moving a project to the production stage.
In addition, this post will teach you how to alias instantly by running
now alias and customizing your config.
At the core of the philosophy behind Now are immutable deployments.
This means that each time you run
now, you get a new deployment (rather than updating an existing one). Its URL will be copied to your clipboard automatically, letting you share it right away.
This basically provides our users with a secure sandbox right before the production level. Why?
As you can see, staging your application before "moving it" to production using
now alias comes with many neat benefits. Therefore, it's generally a good practise to take advantage of this functionality!
For most projects, the production domain always stays the same. This results in you having to run
now alias over and over again with the same values.
To automate this, we recently introduced the
alias property for your
now.json file. The property either accepts a string containing a single alias:
Or an array with multiple aliases in it:
"alias": [ "zeit.chat", "chat.zeit.co" ]
Independent from the value type you've chosen, all of the aliases listed there will be assigned to the most recent deployment when
now alias (without any arguments) is run.
Each time you run the command, the alias will get copied to your clipboard (
now will pick the last one if your
alias property contains multiple ones).
It also doesn't matter if the alias already exists or not. If it doesn't, Now will create it and lead you through the steps required for connecting the domain. Easy as pie, isn't it?