sleep-tracker-backend/api/server.js

20 lines
536 B
JavaScript
Raw Normal View History

2019-07-31 07:14:12 +00:00
const express = require("express");
const helmet = require('helmet');
const cors = require('cors');
const authRouter = require('../services/auth/authRouter');
2019-08-01 07:42:25 +00:00
const usersRouter = require('../services/users/usersRouter');
2019-08-01 14:25:44 +00:00
const sessionsRouter = require('../services/sessions/sessionsRouter');
2019-07-31 07:14:12 +00:00
const server = express();
server.use(helmet());
server.use(express.json());
server.use(cors());
server.use('/api/auth', authRouter);
2019-08-01 07:42:25 +00:00
server.use('/api/users', usersRouter);
2019-08-01 14:25:44 +00:00
server.use('/api/users', sessionsRouter);
2019-07-31 07:14:12 +00:00
module.exports = server;