update api.js

This commit is contained in:
2024-10-24 16:18:41 +02:00
parent 090ef7938e
commit 723061df27

View File

@@ -31,7 +31,7 @@ router.get('/itemsdb', (req, res) => {
/** /**
* @swagger * @swagger
* /metricdb/{id}: * /metric/{id}:
* get: * get:
* description: Use to request metrics by project ID * description: Use to request metrics by project ID
* parameters: * parameters:
@@ -47,7 +47,7 @@ router.get('/itemsdb', (req, res) => {
* 500: * 500:
* description: Internal server error * description: Internal server error
*/ */
router.get('/metricdb/:id', (req, res) => { router.get('/metric/:id', (req, res) => {
const projectId = req.params.id; const projectId = req.params.id;
const query = 'SELECT * FROM public.metrique WHERE id_projet = $1'; const query = 'SELECT * FROM public.metrique WHERE id_projet = $1';
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:5500'); res.setHeader('Access-Control-Allow-Origin', 'http://localhost:5500');