Files
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

26 lines
707 B
JavaScript

const express = require('express');
const router = express.Router();
module.exports = router;
const houses = require('../houses.json')
const sortingHatQuotes = require('../sortinghatquotes.json')
function getRandomHouseName() {
let houseNames = houses.map(house => house.name);
return houseNames[Math.floor(Math.random() * houseNames.length)];
}
function getRandomQuote() {
return sortingHatQuotes[Math.floor(Math.random() * sortingHatQuotes.length)];
}
router.get('/', function (req, res) {
let house = getRandomHouseName();
setTimeout(() => {
return res.json({
sortingHatSays: getRandomQuote() + ' ' + house,
house: house
})
}, 500)
});