14 lines
355 B
JavaScript
14 lines
355 B
JavaScript
|
const Router = require("@koa/router");
|
||
|
const controller = require("../../controllers/static");
|
||
|
|
||
|
const router = Router();
|
||
|
|
||
|
router
|
||
|
.param("file", async (file, ctx, next) => {
|
||
|
ctx.file = file || "index.html";
|
||
|
await next();
|
||
|
})
|
||
|
.get("/_builder/:file*", controller.serveBuilder)
|
||
|
.get("/:appName", controller.serveApp);
|
||
|
|
||
|
module.exports = router;
|