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
507 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 12:04:07 +02:00
// Récupère les fonctions
.get(functionsController.getFunctions)
2020-03-23 16:50:31 +01:00
FunctionsRouter.route('/:slug')
2020-08-03 12:04:07 +02:00
// Récupère les informations de la fonction par son slug
.get(functionsController.getFunctionBySlug)
2020-08-03 12:04:07 +02:00
// Exécute la fonction demandée en paramètre
.post(functionsController.executeFunctionBySlug)
2020-08-03 12:04:07 +02:00
module.exports = FunctionsRouter