Expedite Server
A simple, fast wrapper for getting Express HTTP and WebSocket servers up, running, and maintained.
Why?
Express is nice and concise and that is exactly what a lot of minimalist, simple services need. But, in larger projects, there are a lot of decisions to be made about how to best used express. The goal of Expedite Server
is to create both a minimalist framework on top of Express AND provide large-project level abstractions for ease of separation and interaction.
Installation
$ npm install expedite
Fast example
var Expedite = ; // Create a root endpoint that just returns the default JSON object with data set to "Thank you!" ; // Run the server Expeditestart;
Configuring a server
var Server = ; var config = {}; configport = 9001; configname = "Hello World"; var server = config ; server; // Alternate configurations can be supplied var devConfig = {}; devConfigenvironment = "dev"; // Merged configurations will look through the arguments used to spawn // the process and determine if they should be merged into the server's // configuration object. // If this server was started with the arg 'dev', then the specified config // will be merged in, otherwise discarded. server; // Endpoints should be added individually server; serverstart;
Building an endpoint
var Endpoint = ; // Endpoint instance that all actions will be attached to var root = "root" ; // Secure endpoint (using default policy) // @NOTE: 'then' is not a thenable, just a function convention root; // Non-secure endpoint posting to the same root URL, // note that 'id' is required as part of the query parameter // and 'name' is required as part of the posted body. root ; root; // Endpoint is exported for requiring in by the entry point module (see: server above) moduleexports = root;
WebSockets
Coming soon!
Mock Dummies
Coming soon!