Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.59 KB

README.md

File metadata and controls

45 lines (31 loc) · 1.59 KB

💂 Yeoman generator to create NodeJS web server scaffolding using express-js

Requirements

npm install -g yo
npm install -g generator-webserver

Use

Before running the generator you will need to create a folder for your project where the generator will create all the project files and directories.

Once you have, NodeJS, Yeoman, generator-webserver installed and your project folder created you can run the generator using:

mkdir project
cd project
yo webserver
npm start

Webserver options are:

  • Project name Used for .env
  • Template engine We currently only support nunjucks. Use it if you want frontend in you webserver.
  • PM2 Recommended Production Process Manager for Node.js
  • Database driver We currently support mysql (build with sequelize) | mongodb (build with mongoose)

Scaffolding details

Inside server we can find:

middleware.js Here we can set up our default middlewares like user auth, or whatever. container.js Register everthing inside providers folder using simple-di.

Use providers to inject models (for instance) to our controllers. And avoid bad practices (direct imports inside controllers).

License

This project is released under the WTFPL LICENSE.