-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
29 lines (22 loc) · 798 Bytes
/
server.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
28
const express = require('express');
const bodyParser = require('body-parser');
const api = require('./api/routes/indexRoute');
require('dotenv').config();
const app = express();
app.use(bodyParser.json());
app.use(
bodyParser.urlencoded({
extended: false
})
);
app.use('/api/v1', api)
app.get('/', (req, res) => {
res.status(200).json({msg:'Welcome',
API_endPoint: `http://localhost:4000/api/v1/getmeals/{mealIds}`,
Note: ` 'mealIds' should be substituted for meal Id from https://www.themealdb.com, for multiple separate with ',' e.g http://localhost:4000/api/v1/getmeals/52892,52850,52876`
});
});
const port = process.env.PORT || 4000
app.listen(port, () => {
console.log(`Server Runining On port ${port}`);
});