mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
20 lines
523 B
JavaScript
Executable File
20 lines
523 B
JavaScript
Executable File
import path from "path"
|
|
import createRoutesFromDirectory from "@utils/createRoutesFromDirectory"
|
|
import getMiddlewares from "@utils/getMiddlewares"
|
|
|
|
export default async (router) => {
|
|
const routesPath = path.resolve(__dirname, "routes")
|
|
|
|
const middlewares = await getMiddlewares(["withOptionalAuth"])
|
|
|
|
for (const middleware of middlewares) {
|
|
router.use(middleware)
|
|
}
|
|
|
|
router = createRoutesFromDirectory("routes", routesPath, router)
|
|
|
|
return {
|
|
path: "/stream",
|
|
router,
|
|
}
|
|
} |