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