Skip to content

Instantly share code, notes, and snippets.


parzibyte/app.js Secret

Last active December 21, 2020 16:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var enrutadorVideojuegos = require('./routes/videojuegos');
var app = express();
app.use((req, res, next) => {
res.set("Access-Control-Allow-Credentials", "true");
res.set("Access-Control-Allow-Origin", "http://localhost:3000");
res.set("Access-Control-Allow-Headers", "Content-Type");
res.set("Access-Control-Allow-Methods", "OPTIONS,GET,PUT,POST,DELETE");
app.use(express.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/videojuegos', enrutadorVideojuegos);
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment