Create a pre-configured HTTP server
I've found my self writing this particular piece of snippet over and over again. If you need to have a common API for creating a HTTP, HTTPS or SPDY server this might be the module that you've been waiting for.
Add it to your Node.js project by running
npm install --save create-server
In all code examples we assume that you've required the module and saved it as
'use strict';var create = require'create-server';
create variable is now a function which can be used to create different
types of servers. The function accepts 2 different arguments:
The following properties can be configured:
The following properties can be provided as callback object:
When creating a secure server, we will do our best to provide sane defaults that
will protect your server against known secure server attacks such as POODLE, we
also update the cipher list to prevent attacks such as heart bleed. This can be
overridden by supplying your own
keys as option.