cors test

This commit is contained in:
adueck 2023-01-30 00:50:01 +05:00
parent f5683a7c6e
commit 78d3f56319
1 changed files with 4 additions and 4 deletions

View File

@ -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