-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathweb.js
43 lines (30 loc) · 879 Bytes
/
web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(function() {
var app, express, http, path, port, pub, routes;
require("coffee-script");
express = require("express");
routes = require("./routes");
http = require("http");
path = require("path");
pub = __dirname + "/public";
port = process.env.PORT || 5000;
app = express.createServer(express.logger());
app.configure(function() {
app.set("port", port);
app.use(express.logger());
app.use(express.static(pub));
app.set("views", __dirname + "/views");
app.set("view engine", "jade");
app.use(app.router);
return app.use(express.compiler({
src: pub,
enable: ["less"]
}));
});
app.configure("development", function() {
return app.use(express.errorHandler());
});
app.get("/", routes.index);
app.listen(port, function() {
return console.log("Listening on " + port);
});
}).call(this);