import express from "express"; import type { Express } from "express"; import cors from "cors"; import allowSetup from "../middleware/allowSetup"; import authenticate from "../middleware/authenticate"; import errorHandler from "../middleware/errorHandler"; import publicAvailable from "./public"; import setup from "./setup"; import auth from "./auth"; import admin from "./admin/index"; import user from "./user"; 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("/public", publicAvailable); app.use("/setup", allowSetup, setup); app.use("/auth", auth); app.use(authenticate); app.use("/admin", admin); app.use("/user", user); app.use(errorHandler); };