Following instructions here.
$ now domains add philngo.com
(verify_now TXT
record)$ now domains verify philngo.com
(should see Success!)- Add a ALIAS record for
philngo.me
pointing toalias.zeit.co
. - Add a CNAME record for
www.philngo.me
pointing toalias.zeit.co
. - Run
now alias https://philngome-g68g4s0f8.now.sh/ philngo.me
. This fails but has token we can use for verification. - Add the
_now
TXT record that was in the output (has verification token). - Run
now alias https://philngome-g68g4s0f8.now.sh/ philngo.me
again. (This succeeds and gives us a cert too). - Add
"alias": ["philngo.me", "www.philngo.me"]
, which means this alias is applied on master branch deploys.
Vue project created using vue cli v3.2.1. with yarn. See Configuration Reference.
cd ..
vue create -n philngo.me # use defaults
cd philngo.me
vue add router
vue add vuex
After that was set up with default config, add the following to connect now and the vue build.
# add to package.json
"scripts": {
...
"now-build": "npm run build"
}
# add to now.json
"builds": [
...
{ "src": "package.json", "use": "@now/static-build" }
]
# for html5 history
"routes": [
...
{ "src": "/((?!\\.js|\\.css|\\.html|\\.ico|\\.map).)*$", "dest": "index.html" }
]
- Make a PR at github.
- Zeit will make a new deployment from that branch.
- Merge and the new master will be deployed to philngo.me.
yarn install # initial setup
yarn run serve # local dev server
There doesn't seem to be a good way to run a local dev version of the now-based
API, so here's a workaround: set the following in .env.local
, which is not
version-controlled. This will point the locally running app at any deployed
version of the API. With now, basically every commit on every PR branch gets
deployed.
# .env.local
VUE_APP_API_SERVER=https://philngo.me