feat: root paden toegevoegd aan endpoints
This commit is contained in:
		
							parent
							
								
									2e87710fe6
								
							
						
					
					
						commit
						b85374afa8
					
				
					 7 changed files with 71 additions and 1 deletions
				
			
		|  | @ -1,6 +1,16 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         assignments: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about an assignment with id 'id'
 | // information about an assignment with id 'id'
 | ||||||
| router.get('/:id', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|  |  | ||||||
|  | @ -1,6 +1,16 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         classes: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about an class with id 'id'
 | // information about an class with id 'id'
 | ||||||
| router.get('/:id', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|  |  | ||||||
|  | @ -1,6 +1,16 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         groups: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about a group (members, ... [TODO DOC])
 | // information about a group (members, ... [TODO DOC])
 | ||||||
| router.get('/:id', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|  |  | ||||||
|  | @ -1,6 +1,16 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         questions: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about an question with id 'id'
 | // information about an question with id 'id'
 | ||||||
| router.get('/:id', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|  |  | ||||||
|  | @ -1,6 +1,16 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         students: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about a student's profile
 | // information about a student's profile
 | ||||||
| router.get('/:id', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|  |  | ||||||
|  | @ -1,6 +1,16 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         submissions: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about an submission with id 'id'
 | // information about an submission with id 'id'
 | ||||||
| router.get('/:id', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|  |  | ||||||
|  | @ -1,8 +1,18 @@ | ||||||
| import express from 'express' | import express from 'express' | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  | // root endpoint used to search objects
 | ||||||
|  | router.get('/', (req, res) => { | ||||||
|  |     res.json({ | ||||||
|  |         teachers: [ | ||||||
|  |             '0', | ||||||
|  |             '1', | ||||||
|  |         ] | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // information about a teacher
 | // information about a teacher
 | ||||||
| router.get('/:id/', (req, res) => { | router.get('/:id', (req, res) => { | ||||||
|     res.json({ |     res.json({ | ||||||
|         id: req.params.id, |         id: req.params.id, | ||||||
|         firstName: 'John', |         firstName: 'John', | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Adriaan Jacquet
						Adriaan Jacquet