-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (28 loc) · 957 Bytes
/
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
// npm
var express = require('express');
var morgan = require('morgan');
var bodyParser = require('body-parser');
// Route
var index = require('./routes/index');
var app = express();
// set
app.set('view engine', 'jade');
app.set('views', './views');
app.use(morgan('dev'));
app.use(express.static('public'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css'));
app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js'));
app.use('/js', express.static(__dirname + '/node_modules/vue/dist'));
app.use('/js', express.static(__dirname + '/node_modules/jquery/dist'));
app.use('/', index);
app.use(function(req, res, next) {
var err = new Error('Not Found - 404');
err.status = 404;
next(err);
});
app.listen(process.env.PORT || 8080, function(){
console.log("Connected 8080 port");
});
module.exports = app;