-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (31 loc) · 917 Bytes
/
index.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
29
30
31
32
33
34
35
36
37
38
39
40
const express = require('express');
const app = express();
const cors = require('cors');
const port = process.env.PORT || 5000;
const bannerDishes = require('./data/bannerDishes.json');
const headLines = require('./data/headlines.json');
const chefs = require('./data/chefs.json');
const tipsAndTricks = require('./data/tipsAndTricks.json');
const healthTips = require('./data/healthTips.json');
app.use(cors());
app.get('/', (req, res) => {
res.send('Recipe Hunter is running')
});
app.get('/bannerdishes', (req, res) => {
res.send(bannerDishes);
})
app.get('/headlines', (req, res) => {
res.send(headLines);
})
app.get('/chefs', (req, res) => {
res.send(chefs);
})
app.get('/tips', (req, res) => {
res.send(tipsAndTricks);
})
app.get('/healthtips', (req, res) => {
res.send(healthTips);
})
app.listen(port, () => {
console.log(`Recipe Hunter API is running on port: ${port}`)
})