index.js
741 Bytes
module.exports =
config = require('./config/config.json');
knex = require('knex')(config.db);
express = require('express');
router = express.Router();
var app = express();
app.use(express.json({limit: '550mb'}));
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader(
'Access-Control-Allow-Headers',
'Origin, X-Requested-With, Content-Type, Accept, X-Terminal-Key, X-Nombre-Usuario, X-Punto-Venta'
);
res.setHeader('Access-Control-Allow-Methods', 'POST, GET, DELETE, OPTIONS');
next();
});
app.listen(config.port, '0.0.0.0', () => {
console.log(`Escuchando puerto ${config.port}`);
});
app.use('/', [
require('./rutas/articulos'),
require('./rutas/imagenes'),
]);