summaryrefslogtreecommitdiff
path: root/app/node_modules/okserver/index.js
blob: adef189eb2536ea97db9ac337e1ba06fc93cbfca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var express = require('express');

function OKServer(options) {
  if (!(this instanceof OKServer)) return new OKServer(options);
  options = options || {};
  this._app = express();
}

OKServer.prototype.addView = function addView(route, view) {
  this._app.use(route, view.middleware());
  return this;
};

OKServer.prototype.listen = function listen(port) {
  this._app.listen(port || 1337);
  return this;
};

module.exports = OKServer;