-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.js
28 lines (23 loc) · 792 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
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const roomRouter = require('./routes/roomRoute');
const liveRouter = require('./routes/liveRoute');
const missionRouter = require('./routes/missionRoute');
const app = express();
const PORT = 8000;
app.use(cors())
app.use(bodyParser.json());
app.listen(PORT, () => {
console.log(`Server Running on port http://localhost:${PORT}`);
});
app.get('/', (req, res) => {
res.send({
message: 'Welcome To JKT48 SHOWROOM API',
author: 'https://github.com/ikhbaldwiyan',
repository: 'https://github.com/ikhbaldwiyan/jkt48-showroom-api'
})
});
app.use('/api/rooms', roomRouter);
app.use('/api/lives', liveRouter);
app.use('/api/missions', missionRouter);