backend/api/server.js

31 lines
931 B
JavaScript
Raw Normal View History

const express = require('express');
const cors = require('cors');
const helmet = require('helmet');
require('dotenv').config();
const accountsRoute = require('./routes/accountRoute');
const meetingsRoute = require('./routes/meetingRoute');
2020-05-04 16:47:05 +00:00
const participantsRoute = require('./routes/participantRoute');
2020-05-05 09:34:30 +00:00
const possibleDatesRoute = require('./routes/possibleDateRoute');
const availibilityRoute = require('./routes/availibilityRoute');
const server = express();
server.use(cors());
server.use(express.json());
server.use(helmet());
server.use('/api/accounts', accountsRoute);
server.use('/api/meetings', meetingsRoute);
2020-05-04 16:47:05 +00:00
server.use('/api/participants', participantsRoute);
2020-05-05 09:34:30 +00:00
server.use('/api/possible-dates', possibleDatesRoute);
server.use('/api/availibility', availibilityRoute);
server.get('/', (req, res) =>
res
.status(200)
.send('<h2>Welcome to Meeting Planner Backend API service.</h2>'),
);
module.exports = server;