19 lines
465 B
JavaScript
19 lines
465 B
JavaScript
const express = require('express');
|
|
const app = express();
|
|
const route = '/primer_semestre';
|
|
const controllerPath = '../controller/PrimerSemestre';
|
|
const registrar = require(`${controllerPath}/registrar`);
|
|
|
|
// POST
|
|
app.post(`${route}/registrar`, (req, res) => {
|
|
return registrar(req.body)
|
|
.then((data) => {
|
|
res.status(200).json(data);
|
|
})
|
|
.catch((err) => {
|
|
res.status(400).json({ message: err.message });
|
|
});
|
|
});
|
|
|
|
module.exports = app;
|