2ex (pronounced 2X)
A semi-opinionated framework for setting up Express apps.
Install
$ npm install --save 2ex
Usage
const createApp = const runApp = // Start the app
What does it do?
This package sets up common requirements for running an Express app in production with the goal of reducing boilerplate in your applications. Here is a list of some of those things:
- Uses next gen Express (
5.0.0-alpha.7
at the time of publishing this)- See the GitHub PR for 5.0 for details
- New and improved
path-to-regex
- Router with basic promise support
- Express app settings
- Remove
x-powered-by
header - Sets query string parsing to
simple
(faster, more secure, planned default for 5.0)
- Remove
- Set process title (nice for identifying your server process)
- Catch, report and exit on
uncaughtException
andunhandledRejection
- Handle and report server
clientError
s - Parses JSON bodies
- Parses cookies (off by default, turn on by passing
options.parseCookies