Skip to content

Usage

Here are some uses of the cli on tools-web.

Express

Basic command:

  • Start command

    bash
    express -h
    express -h
  • Create new project

    bash
    # template choice is "dust", "ejs", "hbs", "hjs", "jade", "pug", "twig"
    # db choice is "mongoose", "sequelize"
    express make:project --template ejs --db mongoose
    # template choice is "dust", "ejs", "hbs", "hjs", "jade", "pug", "twig"
    # db choice is "mongoose", "sequelize"
    express make:project --template ejs --db mongoose
  • Create new api

    bash
    express make:api user --db mongoose --col name,email,phone
    express make:api user --db mongoose --col name,email,phone
  • Create new model

    bash
    express make:model User --db mongoose --col name,email,phone
    express make:model User --db mongoose --col name,email,phone
  • Run the server on the background

    bash
    express dev
    express dev

    WARNING

    don't be remove on this line at app.js

    javascript
    // catch 404 and forward to error handler
    app.use(function (req, res, next) {
      next(createError(404));
    });
    // catch 404 and forward to error handler
    app.use(function (req, res, next) {
      next(createError(404));
    });

Cheatsheet

CommandDescriptionArgumentsOptions
make:projectCreate new project
server:devRun the server application on the background
make:modelGenerate model<name>
make:apiGenerate api<name>

Released under the MIT License.