X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=server%2Fapp.js;h=b1aee52c6a79ec131dcf253f85fcee0abf1098e8;hb=98db2082fd31e7a7bc0348e31ce119f39dbc31b3;hp=aa8cade0cb85bb13cb1fb1ba85dc2003f9bdaa14;hpb=625022fdcf750f0aff8fcd699f7e9b89730e1d10;p=vchess.git diff --git a/server/app.js b/server/app.js index aa8cade0..b1aee52c 100644 --- a/server/app.js +++ b/server/app.js @@ -7,7 +7,7 @@ var favicon = require('serve-favicon'); var app = express(); -app.use(favicon(path.join(__dirname, "favicon", "favicon.ico"))); +app.use(favicon(path.join(__dirname, "static", "favicon.ico"))); if (app.get('env') === 'development') { @@ -27,13 +27,13 @@ else app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); -app.use(express.static(path.join(__dirname, 'serve'))); //client "prod" files +app.use(express.static(path.join(__dirname, 'static'))); //client "prod" files // In development stage the client side has its own server -if (app.get('env') === 'development') +if (params.cors.enable) { app.use(function(req, res, next) { - res.header("Access-Control-Allow-Origin", "*"); + res.header("Access-Control-Allow-Origin", params.cors.allowedOrigin); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next();