Lines 138-178javascript
139 <details${frameHtml ? "" : " open"}><summary>Stack trace</summary><pre class="stack">${esc(stack)}</pre></details>
140 <p class="foot">Fix the error and save \u2014 this page reloads automatically.</p>`;
141 return page(`${kind} \u2014 Apex JS`, body);
143function renderNotFoundPage(url, routes) {
144 const list = routes.length ? routes.map((r) => `<li>${esc(r.pattern)}</li>`).join("") : "<li>no pages yet \u2014 add pages/index.alpine</li>";
146 <div class="brand">${MARK} Apex JS <span class="pill nf">404</span></div>
147 <p class="kind nf">404 \u2014 Not found</p>
148 <h1>No route matches <code>${esc(url)}</code></h1>
149 <p class="sub">These routes are available:</p>
150 <ul class="routes">${list}</ul>
151 <p class="foot">Add a file under <code>pages/</code> to create a new route.</p>`;
152 return page("404 \u2014 Apex JS", body);
156async function startDevServer(options) {
157 const port = options.port ?? 3e3;
158 const pageId = options.pageId ?? "/pages/index.alpine";
159 const req = createRequire(import.meta.url);
160 const tryResolve = (spec) => {
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/server-PTHGOE42.jsView on unpkg · L158 162 return req.resolve(spec);
167 const alpine = tryResolve("alpinejs");
168 const kit = tryResolve("@apex-stack/kit");
169 const coreClient = fileURLToPath(new URL("./client.js", import.meta.url));
170 const coreSelf = fileURLToPath(new URL("./index.js", import.meta.url));
172 "@apex-stack/core/client": coreClient,
173 "@apex-stack/core": coreSelf
175 if (alpine) alias.alpinejs = alpine;
176 if (kit) alias["@apex-stack/kit"] = kit;
177 const plugins = [apex({ clientRuntime: "@apex-stack/core/client" })];