express-app-server
A script to serve an express app
Last updated 5 months ago by makinde .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install express-app-server 
SYNC missed versions from official npm registry.

express-app-server

A production ready script to start up an express app.

Motivation

When building lots of express apps, there's boilerplate around serving the express app. Compressions, Forcing HTTPS, and so forth. This module takes an express app that defines all of the things specific to your application, and servers it via HTTP(S) so you don't have to duplicate all the simple steps every time.

Installation

npm i express-app-server

Usage

In your package.json file, add:

"scripts" : {
  "start": "node express-app-server"
}

Now running npm start will start an express server with the app exported in the index.js file in directory where the command is run.

The index file can also return a promise for an app. This is useful when serving next.js apps with a custom server.

Options

Pass the path to your express app as the "--app" argument. You can also specify an init script that will run before any other code. This is useful for instrumentation. Example:

node ./node_modules/express-app-server --app ../apps/app.js --init setupMonitoring.js

You can also specify which script to launch by setting the main flag in your package.json.

"main": "../apps/app.js",

Current Tags

  • 4.0.0                                ...           latest (5 months ago)
  • 4.0.0-0                                ...           next (5 months ago)

25 Versions

  • 4.0.0                                ...           5 months ago
  • 4.0.0-0                                ...           5 months ago
  • 3.1.0                                ...           6 months ago
  • 3.0.2                                ...           7 months ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 3.0.0-0                                ...           a year ago
  • 2.5.4                                ...           a year ago
  • 2.5.3                                ...           a year ago
  • 2.5.2                                ...           a year ago
  • 2.5.1                                ...           a year ago
  • 2.4.2                                ...           a year ago
  • 2.4.1                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.2                                ...           2 years ago
  • 2.3.1                                ...           2 years ago
  • 2.3.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (9)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |