-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
41 lines (23 loc) · 808 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
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var models = require("./models");
var routes = require('./routes/index');
var router = express.Router();
var bcrypt = require('bcrypt');
app.use(express.static(__dirname + '/views'));
app.use('/node_modules',express.static(__dirname + '/node_modules'));
app.use('/app',express.static(__dirname + '/views/app'));
app.set('port', process.env.PORT || 3000);
app.use(bodyParser.json())
app.use('/', routes);
models.sequelize.sync().then(function () {
var server = app.listen(app.get('port'), function() {
console.log('Express server listening on port ' + server.address().port);
});
});
/*
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
*/