-
Notifications
You must be signed in to change notification settings - Fork 14
/
app.js
44 lines (33 loc) · 1.03 KB
/
app.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
44
"use strict";
var express = require("express");
var I18n = require("i18n-2");
var config = require("./config");
require("express-mongoose");
var app = express();
app.disable("x-powered-by");
app.configure(function () {
app.set("port", process.env.PORT || 3000);
app.set("views", __dirname + "/views");
app.set("view engine", "jade");
app.use(express.favicon());
app.use(express.logger("dev"));
app.use(express.bodyParser({
uploadDir: __dirname + "/uploads"
}));
app.use(express.cookieParser());
app.use(express.methodOverride());
I18n.expressBind(app, {
locales: config.locales
});
app.use(express.static(__dirname + "/public"));
});
app.configure("development", function () {
app.use(express.errorHandler());
});
app.use(require("./middleware/set-locale"));
app.use(require("./middleware/load-navigation"));
app.use(require("./middleware/build-breadcrumbs"));
app.use(require("./middleware/load-page"));
app.use(app.router);
require("./routes")(app);
module.exports = app;