https://github.com/pdroll/es6-node-server
Boilerplate Node.js server that enables you to write with the ECMAScript 2015 syntax.
https://github.com/pdroll/es6-node-server
Last synced: 12 months ago
JSON representation
Boilerplate Node.js server that enables you to write with the ECMAScript 2015 syntax.
- Host: GitHub
- URL: https://github.com/pdroll/es6-node-server
- Owner: pdroll
- Created: 2016-02-02T04:31:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T04:09:14.000Z (almost 10 years ago)
- Last Synced: 2025-04-09T09:17:00.835Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ES6 Node Server Boilerplate
Easily write your [Express](http://expressjs.com/) Node application in the [ES2015 syntax](https://babeljs.io/docs/learn-es2015/). Ideal for writing API's.
Uses [Babel](https://babeljs.io/) to compile your code, so you have access to the full ES2015 spec (and then some) regardless of what version of Node.js your server is running.
Support for the [object spread operator](https://babeljs.io/docs/plugins/transform-object-rest-spread/) and [class properties](https://babeljs.io/docs/plugins/transform-class-properties/) is included for your programming enjoyment.
## Run Locally
```
npm start
```
Speeds up development by using [Nodemon](http://nodemon.io/) to restart the application when a file is changed.
## Run in Production
Compile your ES2015 to ES5 by running:
```
npm run compile
```
Then you can run the compiled version by running:
```
node compiled_server.js
```
## Run in Production with High Availability
If you want to ensure your application stays online, even if your script encounters an error, [PM2](http://pm2.keymetrics.io/) has your back.
Ensure PM2 is installed on your machine:
```
npm install pm2 -g
```
Then to compile your ES2015 code to straight ES5 code and serve the compiled version with PM2, you can run:
```
npm run startProd
```