bootstrapp

0.0.0 • Public • Published

bootstrapp

Build Status Code Climate David DM

Express basic boilerplate. With an extra p

Install

npm install bootstrapp --save

Usage

var app = require("bootstrapp");
app.listen(1337, function() {
  console.log("listening...");
});

Set static

app.setStatic(__dirname+"/public");

Set views + engine

app.setViews(__dirname+"/views", "jade");

Define routes

app.setRoutes(function(app) {
  app.get("/", function(req, res) {
    res.send(200);
  });
});

Powered by MiddleEarth which allows you to pop in more middlewares into the stack.

Ex: body-parser

app.middlewares().before("routes", {
  name: 'body-parser',
  cb: bodyParser()
});

Current middleware stack:

// static, this is a noop, services as a starting point to add other middlewares
{name: "static",    fn: noop}
// erros to handle basic error handling
{name: "error-404", cb: erros.fouro4()}
{name: "error-end", cb: erros.handler({views: app.get("views")})}

License

MIT

Package Sidebar

Install

npm i bootstrapp

Weekly Downloads

38

Version

0.0.0

License

MIT

Last publish

Collaborators

  • yunghwakwon