-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
27 lines (23 loc) · 1013 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Using Express for our routes and instantiating API
const express = require("express");
const app = express();
// Parsing request body
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
// Importing the routes for various categories: country, division, gender, type (employment type), restaurant, employees
const country = require('./routes/api/country');
const division = require('./routes/api/division');
const employees = require('./routes/api/employees');
const gender = require('./routes/api/gender');
const restaurant = require('./routes/api/restaurant');
const type = require('./routes/api/type');
app.use("/api/country", country);
app.use("/api/division", division);
app.use("/api/employees", employees);
app.use("/api/gender", gender);
app.use("/api/restaurant", restaurant);
app.use("/api/type", type);
// Run API on localhost:5000
const port = 5000;
app.listen(port, () => console.log(`Server is running on port ${port}`));