feat: root paden toegevoegd aan endpoints

This commit is contained in:
Adriaan Jacquet 2025-02-27 16:30:55 +01:00
parent 2e87710fe6
commit b85374afa8
7 changed files with 71 additions and 1 deletions

View file

@ -1,8 +1,18 @@
import express from 'express'
const router = express.Router();
// root endpoint used to search objects
router.get('/', (req, res) => {
res.json({
teachers: [
'0',
'1',
]
});
});
// information about a teacher
router.get('/:id/', (req, res) => {
router.get('/:id', (req, res) => {
res.json({
id: req.params.id,
firstName: 'John',