feat: add kfu-m-24-1 stubs folder; include eng-it-lean stubs api
This commit is contained in:
21
server/routers/kfu-m-24-1/eng-it-lean/dictionaries/index.js
Normal file
21
server/routers/kfu-m-24-1/eng-it-lean/dictionaries/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const router = require("express").Router();
|
||||
|
||||
module.exports = router;
|
||||
|
||||
const data = require("./data/dictionaries.json");
|
||||
const wordsData = require("./data/dictionaryWords.json");
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
router.get("/:id", (req, res) => {
|
||||
const id = parseInt(req.params.id);
|
||||
const words = wordsData.find((word) => word.id === id);
|
||||
|
||||
if (!words) {
|
||||
return res.status(404).send("Not found");
|
||||
}
|
||||
|
||||
res.send(words);
|
||||
});
|
||||
Reference in New Issue
Block a user