dijkstra-backend/api/server.js

22 lines
609 B
JavaScript
Raw Normal View History

2020-02-07 16:55:43 +00:00
const express = require("express");
const helmet = require('helmet');
const cors = require('cors');
2020-02-07 16:55:43 +00:00
2020-02-08 18:59:51 +00:00
const citiesRouter = require('./routes/citiesRouter');
const roadsRouter = require('./routes/roadsRouter');
const countriesRouter = require('./routes/countriesRouter');
const pathRouter = require('./routes/pathRouter')
2020-02-07 16:55:43 +00:00
const server = express();
server.use(helmet());
2020-02-07 16:55:43 +00:00
server.use(express.json());
server.use(cors());
2020-02-07 16:55:43 +00:00
2020-02-08 18:59:51 +00:00
server.use('/api/cities', citiesRouter);
server.use('/api/roads', roadsRouter);
server.use('/api/countries', countriesRouter);
server.use('/api/path', pathRouter);
2020-02-07 16:55:43 +00:00
module.exports = server;