dijkstra-backend/api/server.js

22 lines
609 B
JavaScript

const express = require("express");
const helmet = require('helmet');
const cors = require('cors');
const citiesRouter = require('./routes/citiesRouter');
const roadsRouter = require('./routes/roadsRouter');
const countriesRouter = require('./routes/countriesRouter');
const pathRouter = require('./routes/pathRouter')
const server = express();
server.use(helmet());
server.use(express.json());
server.use(cors());
server.use('/api/cities', citiesRouter);
server.use('/api/roads', roadsRouter);
server.use('/api/countries', countriesRouter);
server.use('/api/path', pathRouter);
module.exports = server;