refactor: restructure to monorepo with backends and apiTest

- Move web/backend to backends/potter-api
- Move web/frontend to backends/potter-api/frontend
- Add root package.json with npm workspaces
- Update README.md with monorepo navigation
- Update .github/workflows/api-tests.yml for dynamic test discovery
- Update bruno_test_scenario.md paths
- Fix .gitignore to allow JSON data files
- Add three new AI tests in apiTest/PotterAPI/AI/

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
kankys committed 2026-09-15 21:08:39 +02:00
1 parent 2e185b47ef
commit d0cdabbf11
57 files changed
+292 -35

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
let jwt = require('jsonwebtoken');
module.exports = checkToken;
function checkToken(req, res, next) {
jwt.verify(req.token, 'secretkey', (err, authData) => {
if (err) {
res.status(403);
res.send(err);
} else {
next();
}
})
}
+6
View File
@@ -0,0 +1,6 @@
exports.checkHeader = (req, res, next) => {
if (!req.is('application/json')) {
res.status(400).send({ message: "Sorry Nick you dont have HEADer" });
}
next();
}
@@ -0,0 +1,9 @@
let spells = require('../controllers/spellsController.js')
exports.spell_not_found = function (req, res, next) {
let result = spells.find(spell => spell._id == req.params.spellId);
if (typeof result == 'undefined') {
return res.status(404).send({ message: "Spell not found" });
}
next();
}