2020-04-14 16:14:57 +02:00
|
|
|
const Router = require("@koa/router");
|
|
|
|
const controller = require("../../controllers/static");
|
|
|
|
|
|
|
|
const router = Router();
|
|
|
|
|
|
|
|
router
|
|
|
|
.param("file", async (file, ctx, next) => {
|
2020-04-28 15:39:35 +02:00
|
|
|
ctx.file = file && file.includes(".") ? file : "index.html";
|
2020-04-14 16:14:57 +02:00
|
|
|
await next();
|
|
|
|
})
|
|
|
|
.get("/_builder/:file*", controller.serveBuilder)
|
|
|
|
.get("/:appName", controller.serveApp);
|
|
|
|
|
|
|
|
module.exports = router;
|