app-server

2.0.0 • Public • Published

App Server

A wrapper around a common configuration for an express application server. This module wraps the following modules:

It setup sane defaults for these modules and exposes simple confiuration options for tweaking. But overall it is an opinionated method for setting up an express service.

Install

$ npm install --save app-server

Basic Usage

var Server = require('app-server');
 
// All these options are set to their default values
var server = new Server({
    port: 3000,
    hostname: null,
    logDir: 'log',
    logger: logtastic, // An instance of Logtastic
    trustProxy: true,
    compress: true,
    errorHandler: true,
    parseCookies: false,
    viewDir: null, // Full path to views
    viewEngine: null, // One of the modules provied by consolidate
    viewEngineSuffix: 'html'
});
 
// Setup routes
server.app.post('/', function(req, res) {
    res.status(200).json({hi: 'planet'});
});
 
// Start the server
server.start();

Readme

Keywords

Package Sidebar

Install

npm i app-server

Weekly Downloads

2

Version

2.0.0

License

ISC

Last publish

Collaborators

  • wesleytodd