-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp.js
More file actions
41 lines (35 loc) · 810 Bytes
/
app.js
File metadata and controls
41 lines (35 loc) · 810 Bytes
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
var express = require('express');
var path = require('path');
var app = express();
var passport = require('passport');
/*
* 載入全域變數與設定
*/
require('./Global');
/*
* middlewares
*/
require('./middlewares')(app);
/*
* view引擎設定,dir = project_path/views,use jade
*/
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
/*
*static file設定 in project_path/public and project_path/bower_components
*/
app.use(express.static(path.join(__dirname, '/public')));
app.use(express.static(__dirname + '/bower_components'));
/*
* 設定passport function
*/
require('./config/passport')(passport);
/*
* api
*/
require('./controllers')(app,passport);
/*
* errorHandler
*/
require('./errorHandler')(app);
module.exports = app;