This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/api/routes/functions.js

20 lines
513 B
JavaScript
Raw Normal View History

2020-08-03 12:04:07 +02:00
const { Router } = require('express')
const functionsController = require('../controllers/functions')
2020-08-03 12:04:07 +02:00
const FunctionsRouter = Router()
FunctionsRouter.route('/')
2020-08-03 14:14:45 +02:00
// Récupère les fonctions
2020-08-03 12:04:07 +02:00
.get(functionsController.getFunctions)
2020-03-23 16:50:31 +01:00
FunctionsRouter.route('/:slug')
2020-08-03 14:14:45 +02:00
// Récupère les informations de la fonction par son slug
2020-08-03 12:04:07 +02:00
.get(functionsController.getFunctionBySlug)
2020-08-03 14:14:45 +02:00
// Exécute la fonction demandée en paramètre
2020-08-03 12:04:07 +02:00
.post(functionsController.executeFunctionBySlug)
2020-08-03 12:04:07 +02:00
module.exports = FunctionsRouter