organización de endpoints
This commit is contained in:
@@ -3,9 +3,10 @@ const app = express();
|
||||
const { verificaToken } = require('../middleware/autentificacion');
|
||||
const route = '/cuestionario_programa';
|
||||
const controllerPath = '../controller/CuestionarioPrograma';
|
||||
const nuevo = require(`${controllerPath}/nuevo`);
|
||||
const get = require(`${controllerPath}/get`);
|
||||
const nuevo = require(`${controllerPath}/nuevo`);
|
||||
|
||||
// POST
|
||||
app.post(`${route}`, verificaToken, (req, res) => {
|
||||
return nuevo(req.body)
|
||||
.then((data) => {
|
||||
@@ -16,6 +17,7 @@ app.post(`${route}`, verificaToken, (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
// GET
|
||||
app.get(`${route}`, verificaToken, (req, res) => {
|
||||
return get(req.query)
|
||||
.then((data) => {
|
||||
|
||||
Reference in New Issue
Block a user