Files
api_test/backends/potter-api/routes/characters.js
T
kankys d0cdabbf11 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>
2026-09-15 21:08:39 +02:00

21 lines
821 B
JavaScript

const express = require('express');
const router = express.Router();
const charactersController = require('../controllers/charactersController.js');
var basicAuth = require('express-basic-auth');
router.use(basicAuth({
users: { 'admin': 'supersecret' },
unauthorizedResponse: {
message: "Sorry Wizard, can't let you in."
}
}));
router.get('/', charactersController.characters_list);
router.post('/', charactersController.new_character);
router.delete('/actions/deleteAll', charactersController.delete_all);
router.get('/actions/reset', charactersController.reset);
router.get('/:characterId', charactersController.specific_character);
router.delete('/:characterId', charactersController.delete_character);
router.put('/:characterId', charactersController.update_character);
module.exports = router;