1 | import * as fs from "node:fs/promises";
|
2 | import * as path from "node:path";
|
3 | import { createRequire } from "node:module";
|
4 | import { __PRODUCTION__ } from "./lib/__PRODUCTION__.js";
|
5 | import { defineAkteFiles } from "./defineAkteFiles.js";
|
6 | import { NotFoundError } from "./errors.js";
|
7 | const 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 | });
|
28 | export {
|
29 | akteWelcome
|
30 | };
|
31 |
|