blob: 4a513e9cb07748719c4ca3a28d467643a64a6e2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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) {
console.log(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;
|