Lines 297-337javascript
297 <p class="sub"><code>apex dev</code> looks for <code>pages/*.alpine</code> in <code>${esc(root)}</code>, but found none \u2014 run it from inside your app's folder.</p>
299 <p class="foot">Every Apex app has a <code>pages/</code> directory with at least <code>pages/index.alpine</code>.</p>`;
300 return page("No Apex app \u2014 Apex JS", body);
302function renderNotFoundPage(url, routes) {
303 const list = routes.length ? routes.map((r) => `<li>${esc(r.pattern)}</li>`).join("") : "<li>no pages yet \u2014 add pages/index.alpine</li>";
305 <div class="brand">${MARK} Apex JS <span class="pill nf">404</span></div>
306 <p class="kind nf">404 \u2014 Not found</p>
307 <h1>No route matches <code>${esc(url)}</code></h1>
308 <p class="sub">These routes are available:</p>
309 <ul class="routes">${list}</ul>
310 <p class="foot">Add a file under <code>pages/</code> to create a new route.</p>`;
311 return page("404 \u2014 Apex JS", body);
315async function startDevServer(options) {
316 const port = options.port ?? 3e3;
317 const pageId = options.pageId ?? "/pages/index.alpine";
318 const req = createRequire(import.meta.url);
319 const tryResolve = (spec) => {
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/server-2FN6GV3M.jsView on unpkg · L317 321 return req.resolve(spec);
326 const alpine = tryResolve("alpinejs");
327 const kit = tryResolve("@apex-stack/kit");
328 const coreClient = fileURLToPath(new URL("./client.js", import.meta.url));
329 const coreSelf = fileURLToPath(new URL("./index.js", import.meta.url));
331 "@apex-stack/core/client": coreClient,
332 "@apex-stack/core": coreSelf
334 if (alpine) alias.alpinejs = alpine;
335 if (kit) alias["@apex-stack/kit"] = kit;
336 const plugins = [apex({ clientRuntime: "@apex-stack/core/client" })];
337 let hasTailwind = false;