Browse Source

Add cors and /api prefix to auth routes

main
Haris Razis 4 years ago
parent
commit
a97327f4f2
No known key found for this signature in database GPG Key ID: 86A4D290ED03FAB4
  1. 6
      server/index.js
  2. 1811
      server/package-lock.json
  3. 1
      server/package.json

6
server/index.js

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

1811
server/package-lock.json

File diff suppressed because it is too large

1
server/package.json

@ -15,6 +15,7 @@
"body-parser": "^1.19.0",
"chalk": "^4.1.0",
"cookie-session": "^1.4.0",
"cors": "^2.8.5",
"debug": "^2.6.9",
"express": "^4.17.1",
"express-session": "^1.17.1",

Loading…
Cancel
Save