Skip to content

ironhack/generator

This branch is 38 commits ahead of jalexy12/generator:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

603cd60 · Sep 3, 2018
Sep 3, 2018
Sep 3, 2018
Feb 27, 2017
Dec 22, 2017
Nov 20, 2017
Oct 21, 2016
Aug 29, 2018
Nov 20, 2017
Aug 29, 2018
Aug 29, 2018

Repository files navigation

Ironhack Express application generator.

Logo

Introduction

ironhack_generator is Ironhack's NPM package that allows students to quickly create express projects. The Ironhack-generator is strongly opinionated:

  • Follows industry best practices
  • Predefined directory structure:
    • public: Public Assets folder (css, js, images)
    • models: Mongoose Schemas and models
    • routes: Project routes
    • views: Project views and layouts
  • Views Template: Handlebars
  • CSS Engine: SCSS - Node-sass-middleware
  • ODM: Mongoose
  • Comes prepopulated with popular, useful Express middlewares
    • Logger: morgan
    • Favicon: serve-favicon
    • HTTP POST Params: body-parser
    • Cookies: cookie-parser
  • Error handling: 404 (Not found), 500 (Internal Server Error)
  • Creates project .gitignore - removes node_modules, etc
  • Environment variables loaded from .env configuration file
  • Server monitoring: nodemon

Installation

Install ironhack_generator as a global NPM package, so you can run it from anywhere in your computer:

$ npm install -g ironhack_generator

Quick Start

The quickest way to get started with express is to utilize the executable irongenerate(1) to generate an application as shown below:

Create the app:

$ irongenerate awesome-project/
$ cd awesome-project/

This will generate the following directory structure:

awesome-project/
├── app.js
├── package.json
├── models
├── routes
│   └── index.js
├── views
│    ├── error.hbs
│    ├── index.hbs
│    └── layout.hbs
├── public
│   ├── images
│   ├── javascripts
│   │   └── script.js
│   └── stylesheets
│       └── styles.sass
├── .env
├── .gitignoe
├── bin
    ├── www

Install all dependencies described in package.json:

$ npm install

Start your Express.js app at http://localhost:3000/:

$ npm start

Command Line Options

This generator can also be further configured with the following command line flags.

-h, --help           output usage information
    --version        output the version number
-c, --css <engine>   add stylesheet <engine> support (plain|less|sass|scss) (defaults to scss)
-f, --force          force on non-empty directory
    --git            initialise a Git project

License

MIT

About

Express' application generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.4%
  • HTML 3.9%
  • CSS 0.7%