-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
38 lines (34 loc) · 922 Bytes
/
index.js
File metadata and controls
38 lines (34 loc) · 922 Bytes
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
'use strict'
var express = require('express');
var app = express();
var api = express.Router();
const port = 40000;
var gederShonen = ["Naruto (Shippuden)","One Piece","Fairy Tail"];
var gederIsekai = ["Re:Zero","Overlord","Log Horizon"];
var gederHarem = ["date live","KissSix","Elfen lied"];
//controller
const giveGenderShonen = (req, res) =>{
res.status(200).send({
message: gederShonen
});
};
const giveGenderIsekai = (req, res) =>{
res.status(200).send({
message: gederIsekai
});
};
const giveGenderHarem = (req, res) =>{
res.status(200).send({
message: gederHarem
});
};
//route
api.get("/list_gender/Shonen", giveGenderShonen);
api.get("/list_gender/Isekai", giveGenderIsekai);
api.get("/list_gender/Harem", giveGenderHarem);
// base route
app.use("/api", api);
//host server
app.listen(port, () =>{
console.log('listening on http://localhost' + port)
});