whats going on w cors!!
This commit is contained in:
parent
4127c4f1a4
commit
55bec002e6
|
@ -14,7 +14,11 @@ app.set("view engine", "ejs");
|
|||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.static("public"));
|
||||
app.use(cors({ origin: inProd ? /\.lingdocs\.com$/ : "*", credentials: true }));
|
||||
app.use(cors({
|
||||
origin: "*",
|
||||
// origin: inProd ? /\.lingdocs\.com$/ : "*",
|
||||
credentials: true,
|
||||
}));
|
||||
if (inProd) app.set('trust proxy', 1);
|
||||
setupSession(app);
|
||||
app.use(passport.initialize());
|
||||
|
|
|
@ -48,6 +48,7 @@ apiRouter.get("/user", (req, res, next) => {
|
|||
* adds (passed) test results to the record of the user signed in
|
||||
*/
|
||||
apiRouter.put("/user/tests", async (req, res, next) => {
|
||||
console.log("came into the tests route", req.body.tests);
|
||||
if (!req.user) return next("user not found");
|
||||
try {
|
||||
const { tests } = req.body as T.PostTestResultsBody;
|
||||
|
|
Loading…
Reference in New Issue