feat: Error handling middleware
feat: Ability to get the db variable from everywhere with getDatabase function feat: Hello world when getting root url fix: Now mods model is able to communicate with db fix: fixed a syntax error in routes/mods.js file which caused sending two responses to the client
This commit is contained in:
parent
eb4be67c89
commit
306c87fca2
10 changed files with 315 additions and 19 deletions
|
|
@ -6,7 +6,7 @@ const router = express.Router();
|
|||
// List mods
|
||||
router.get("/", async (req,res) => {
|
||||
console.debug("Accessing mods list");
|
||||
res.send(controller.getAllMods());
|
||||
controller.getAllMods(req,res);
|
||||
// res.send("No list yet");
|
||||
});
|
||||
|
||||
|
|
|
|||
10
src/routes/root.js
Normal file
10
src/routes/root.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
const express = require("express");
|
||||
const controller = require("../controllers/mods");
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', (res, req) => {
|
||||
res.send("Hello there!");
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Loading…
Add table
Add a link
Reference in a new issue