Skip to content

erchaves/node-express-dust

Repository files navigation

node-express-dust vanilla js scaffolding

A vanilla js scaffolding powered by node, express, and dust templating.

Features:

  • Simple ES6 class module structure. No extra framework.
  • Babel with es2015
  • Gulp build process
  • Auto livereload
  • Dust.js template rendering with the same files on server or browser client.
    • Dust is compiled through a helper package Sugarcone. More documentation coming soon for that.
  • Includes a tiny ~3kb of Sprinkles for convenient DOM and AJAX utils.
  • Works on heroku out of the box
  • Includes example of using preact (see "preactor" component) for a simple component with live state updates.

Development Setup

  • Install the dependencies:
npm install
  • Copy or rename readme.env to .env.

    • The .env file will get parsed by app-express.js.
    • .env is .gitignored and can be used to store private tokens.
  • Run the gulp build with livereload and start the server. It will run on port 3000.

npm run dev
# or just run 'gulp' if you have gulp installed globally.
# The app will be served at `localhost:3000`

Production Setup

  • Run the production gulp build and start the server.
npm start
# npm prestart will automatically run the gulp build before starting.
# This works on services like Heroku too. So gulp runs on deploy.

Demo

Future Features

  • Make a simple module base class with a destory function that will auto-unbind events