Scalable IoT solution for real-time body position data
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
785 B

const app = require('express')()
const server = require('http').createServer(app);
const bodyParser = require('body-parser');
const passport = require('./services/passport');
const chalk = require('chalk')
require('./services/socket')(server);
4 years ago
const dataRoute = require('./routes/data')
const authRoute = require('./routes/data')
const {session_secret} = require('./config/keys');
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(
require('cookie-session')({
keys: [session_secret],
maxAge: 30 * 24 * 60 * 60 * 1000
})
);
app.use(passport.initialize(undefined));
app.use(passport.session(undefined));
4 years ago
app.use(dataRoute)
app.use(authRoute)
4 years ago
server.listen(6000, () => {
console.log(chalk.green.bold('Server listening on port 6000!'));
});