Skip to content

Commit

Permalink
chore: moving cors middleware to top (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
aatmanvaidya authored Jul 22, 2024
1 parent d197363 commit 5263a2f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions browser-extension/api-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,23 @@ app.disable("x-powered-by");
const port = 3000;
const cors = require("cors");
const { authentication } = require("./middlewares");
app.use(authentication);


app.use(cors());
app.use(authentication);
app.use(express.json());
app.options("*", cors());


app.use("/" , require("./routes/slur.js")) ;
app.use("/" , require('./routes/archive.js')) ;
app.use("/" , require('./routes/reset.js')) ;
app.use("/" , require('./routes/preference.js')) ;
app.use("/" , require('./routes/predict.js')) ;
app.use("/" , require('./routes/post.js')) ;
app.use("/" , require('./routes/auth.js')) ;
app.use("/" , require('./routes/feedback.js')) ;
app.use("/", require("./routes/slur.js"));
app.use("/", require("./routes/archive.js"));
app.use("/", require("./routes/reset.js"));
app.use("/", require("./routes/preference.js"));
app.use("/", require("./routes/predict.js"));
app.use("/", require("./routes/post.js"));
app.use("/", require("./routes/auth.js"));
app.use("/", require("./routes/feedback.js"));

console.log(`Environment : ${process.env.NODE_ENV}`);


app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});

0 comments on commit 5263a2f

Please sign in to comment.