resource-http

provides an HTTP API

http

a resource for creating and configuring express http servers

  • Easily configurable through simple options hash
  • Based on latest Express 4.x.x
  • Static File Support
  • Session Support
  • HTTPS / SSL
  • OAuth Single Sign On through Passport
  • View Support through View module
  • Body Parser / File Uploads
  • Auto-port detection

see: ./examples/server.js

var http = require('resource-http');
 
// all options are optional and will default to a reasonable value if left unset 
http.listen({
 port: 8888,
 host: 'localhost',
 root: __dirname + "/public",
 view: __dirname + "/view",
 uploads: false,
 https: false,
 autoport: true,
 key: fs.readFileSync(__dirname + "/ssl/server.key").toString(),
 cert: fs.readFileSync(__dirname + "/ssl/cert.crt").toString(),
 ca: fs.readFileSync(__dirname + "/ssl/ca.crt").toString()
}, function(errapp){
 console.log(app.server.address())
 // from here, app is a regular Express server 
 app.get('/foo', function (reqres){
   res.end('got /foo');
 });
});