import express from "express"; import cors from "cors"; import type { Express } from "express"; import errorHandler from "../middleware/errorHandler"; import authenticate from "../middleware/authenticate"; import auth from "./auth"; export default (app: Express) => { app.set("query parser", "extended"); app.use(express.json()); app.use( express.urlencoded({ extended: true, }) ); app.use(cors()); app.options("*", cors()); app.use("/auth", auth); app.use(authenticate); app.use("/secured", (req, res) => { res.send("hallo"); }); app.use(errorHandler); };