Giter VIP home page Giter VIP logo

node-es6-boilerplate's Introduction

ES6-nodejs-server-boilerplate

ES6 server-side boilerplate project. This project contains the following.

  • Automatically compile ES6 style JavScript code to ES5 code with Babel and Webpack
  • Monitoring code changes and server restart with Nodemon
  • Test structure written in ES6 using Mocha and Babel
  • Simple CLI commands for building different environments (development and production)

This project contains a simple HTTP API server using Express. It can easily be changed into something else.

This repo was created for myself and for others to use, where I found myself creating this same project over and over and over and over again.

How to use

  • Copy this folder and name it what you want the service to be named.
  • Find and replace in that folder SERVICE_NAME and name it the same as the folder.
  • When deploying this name the IIS module the same as the folder as well.

Directory structure

Source code is stored under src and tests are stored in test.

Development

To start development, execute the following lines into your shell.

make bootstrap
npm run start-dev

This will install dependencies and start a nodemon process that monitors code changes. When you change your code, it will be compiled with Babel, bundled with Webpack and the server will be restarted automatically.

Build for production

To build the code for production (setting the NODE_ENV to production) run the following commands.

make dist
npm run start

This will create a server bundle in build that you can then run with npm run start

Commands

  • make and make bootstrap execute npm install
  • make clean cleans the project.
  • make dist builds the project with NODE_ENV set to production
  • npm run lint executes eslint for the src folder.
  • npm run test executes mocha with the babel-loader plugin.
  • npm run build executes gulp task named build. This task compiles the code with babel and creates a bundle with webpack.
  • npm run build-watch does the same thing as npm run build but it monitors changes and executes npm run build when code is updated.
  • npm run start-dev does the same thing as npm run build-watch and then executes the built bundle. If the code is changed, the process is restarted with nodemon

node-es6-boilerplate's People

Contributors

arnarthor avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.