UNPKG

892 BJavaScriptView Raw
1import * as fs from "node:fs/promises";
2import * as path from "node:path";
3import { createRequire } from "node:module";
4import { __PRODUCTION__ } from "./lib/__PRODUCTION__.js";
5import { defineAkteFiles } from "./defineAkteFiles.js";
6import { NotFoundError } from "./errors.js";
7const akteWelcome = __PRODUCTION__ ? null : defineAkteFiles().from({
8 path: "/",
9 async data() {
10 try {
11 const require2 = createRequire(path.resolve("index.js"));
12 const aktePath = require2.resolve("akte/package.json");
13 const htmlPath = path.resolve(aktePath, "../dist/akteWelcome.html");
14 return {
15 html: await fs.readFile(htmlPath, "utf-8")
16 };
17 } catch (error) {
18 throw new NotFoundError("/");
19 }
20 },
21 bulkData() {
22 return {};
23 },
24 render(context) {
25 return context.data.html;
26 }
27});
28export {
29 akteWelcome
30};
31//# sourceMappingURL=akteWelcome.js.map