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/quotes.js

16 lines
369 B
JavaScript
Raw Permalink Normal View History

2020-08-03 12:04:07 +02:00
const { Router } = require('express')
const quotesController = require('../controllers/quotes')
const isAuth = require('../middlewares/isAuth')
2020-08-03 12:04:07 +02:00
const QuotesRouter = Router()
QuotesRouter.route('/')
2020-08-03 14:14:45 +02:00
// Récupère les citations
2020-08-03 12:04:07 +02:00
.get(quotesController.getQuotes)
2020-08-03 14:14:45 +02:00
// Proposer une citation
2020-08-03 12:04:07 +02:00
.post(isAuth, quotesController.postQuote)
2020-08-03 12:04:07 +02:00
module.exports = QuotesRouter