Nuxt/examples/pm2-typescript
HG c0311bc22f doc: create/update README.mds for examples (#4980)
* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* Update README.md

* Update README.md

* Create README.md

* Update README.md

* Update README.md

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* Update Readme.md

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* Create README.md

* Update README.md

* Create README.md

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* Update README.md

* Create README.md

* Update README.md

* Update README.md

* Update README.md

* Create README.md

* Update README.md

* Update examples/with-vuikit/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/auth-routes/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/middleware/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/vuex-store-modules/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/with-feathers/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/with-element-ui/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/with-cookies/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/vuex-store/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/vuex-persistedstate/README.md

Co-Authored-By: husayt <husayt@gmail.com>

* Update examples/with-firebase/README.md

Co-Authored-By: husayt <husayt@gmail.com>
2019-02-08 15:48:30 +01:00
..
pages chore(examples): zero-downtime pm2 typescript example (#4907) 2019-02-01 16:37:55 +03:30
README.md doc: create/update README.mds for examples (#4980) 2019-02-08 15:48:30 +01:00
ecosystem.config.js chore(examples): zero-downtime pm2 typescript example (#4907) 2019-02-01 16:37:55 +03:30
nuxt.config.ts chore(examples): zero-downtime pm2 typescript example (#4907) 2019-02-01 16:37:55 +03:30
package.json chore(examples): zero-downtime pm2 typescript example (#4907) 2019-02-01 16:37:55 +03:30
tsconfig.json chore(examples): zero-downtime pm2 typescript example (#4907) 2019-02-01 16:37:55 +03:30
tslint.json chore(examples): zero-downtime pm2 typescript example (#4907) 2019-02-01 16:37:55 +03:30

README.md

Nuxt.ts with PM2 example

pm2 ia an advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management and more.

Gracefull zero-downtime restart

ecosystem.config.js - configuration file for pm2

listen_timeout option depends on your need

Zero-downtime deployment

*all depends on your deployment method. It's just example

Directories:

  • $PROJECT_ROOT - your project root path on server
  • /current - root dir for nginx(if you are using proxy configuration)
  • /_tmp - Temporary dir to install and build project
  • /_old - Previous build. Can be useful for fast reverting

Steps:

  • deploy project to $PROJECT_ROOT/_tmp
  • cd $PROJECT_ROOT/_tmp
  • npm i
  • nuxt build or if you are using TypeScript nuxt-ts build
  • mv $PROJECT_ROOT/current $PROJECT_ROOT/_old
  • mv $PROJECT_ROOT/_tmp $PROJECT_ROOT/current
  • cd $PROJECT_PATH/current
  • pm2 startOrReload ecosystem.config.js