|
@ -3,12 +3,16 @@ const server = require('http').createServer(app); |
|
|
const bodyParser = require('body-parser'); |
|
|
const bodyParser = require('body-parser'); |
|
|
const passport = require('./services/passport'); |
|
|
const passport = require('./services/passport'); |
|
|
const chalk = require('chalk') |
|
|
const chalk = require('chalk') |
|
|
|
|
|
const cors = require('cors') |
|
|
require('./services/socket')(server); |
|
|
require('./services/socket')(server); |
|
|
|
|
|
|
|
|
const dataRoute = require('./routes/data') |
|
|
const dataRoute = require('./routes/data') |
|
|
const authRoute = require('./routes/data') |
|
|
const authRoute = require('./routes/data') |
|
|
const {session_secret} = require('./config/keys'); |
|
|
const {session_secret} = require('./config/keys'); |
|
|
|
|
|
|
|
|
|
|
|
//allow for all requests for development.
|
|
|
|
|
|
app.use(cors()) |
|
|
|
|
|
|
|
|
app.use(bodyParser.urlencoded({ |
|
|
app.use(bodyParser.urlencoded({ |
|
|
extended: true |
|
|
extended: true |
|
|
})); |
|
|
})); |
|
@ -24,7 +28,7 @@ app.use(passport.initialize(undefined)); |
|
|
app.use(passport.session(undefined)); |
|
|
app.use(passport.session(undefined)); |
|
|
|
|
|
|
|
|
app.use(dataRoute) |
|
|
app.use(dataRoute) |
|
|
app.use(authRoute) |
|
|
app.use('/api', authRoute) |
|
|
|
|
|
|
|
|
server.listen(6000, () => { |
|
|
server.listen(6000, () => { |
|
|
console.log(chalk.green.bold('Server listening on port 6000!')); |
|
|
console.log(chalk.green.bold('Server listening on port 6000!')); |
|
|