cors test
This commit is contained in:
parent
f5683a7c6e
commit
78d3f56319
|
@ -14,10 +14,6 @@ const sameOriginCorsOpts = {
|
||||||
origin: inProd ? /\.lingdocs\.com$/ : "*",
|
origin: inProd ? /\.lingdocs\.com$/ : "*",
|
||||||
credentials: true,
|
credentials: true,
|
||||||
};
|
};
|
||||||
// const openCorsOpts = {
|
|
||||||
// origin: "*",
|
|
||||||
// credentials: false,
|
|
||||||
// };
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// MIDDLEWARE AND SETUP 🔧 //
|
// MIDDLEWARE AND SETUP 🔧 //
|
||||||
|
@ -33,6 +29,10 @@ app.use(passport.initialize());
|
||||||
app.use(passport.session());
|
app.use(passport.session());
|
||||||
setupPassport(passport);
|
setupPassport(passport);
|
||||||
|
|
||||||
|
app.get("/test", cors(), (req, res) => {
|
||||||
|
res.send({ ok: true });
|
||||||
|
});
|
||||||
|
|
||||||
// Web Interface - returning html (mostly)
|
// Web Interface - returning html (mostly)
|
||||||
app.use("/", cors(sameOriginCorsOpts), authRouter(passport));
|
app.use("/", cors(sameOriginCorsOpts), authRouter(passport));
|
||||||
// REST API - returning json
|
// REST API - returning json
|
||||||
|
|
Loading…
Reference in New Issue