mirror of
https://github.com/LukasKanka/api_test.git
synced 2026-11-11 14:34:36 +01:00
cicd
This commit is contained in:
1 parent
207c50f51d
commit
e5c6276bab
55 files changed
+28732
No files matched your search
@@ -0,0 +1,14 @@
|
||||
const houses = require('../houses.json');
|
||||
|
||||
exports.houses_list = function (req, res) {
|
||||
res.json(houses);
|
||||
}
|
||||
|
||||
exports.specific_house = function (req, res) {
|
||||
let result = houses.find(house => house.id == req.params.houseId);
|
||||
if (typeof result == 'undefined') {
|
||||
res.status(404)
|
||||
res.send({ message: "House not found" });
|
||||
}
|
||||
res.send(result);
|
||||
}
|
||||
Reference in new issue
Block a user