Lines 310-350javascript
310 <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>
312 <p class="foot">Every Apex app has a <code>pages/</code> directory with at least <code>pages/index.alpine</code>.</p>`;
313 return page("No Apex app \u2014 Apex JS", body);
315function renderNotFoundPage(url, routes) {
316 const list = routes.length ? routes.map((r) => `<li>${esc(r.pattern)}</li>`).join("") : "<li>no pages yet \u2014 add pages/index.alpine</li>";
318 <div class="brand">${MARK} Apex JS <span class="pill nf">404</span></div>
319 <p class="kind nf">404 \u2014 Not found</p>
320 <h1>No route matches <code>${esc(url)}</code></h1>
321 <p class="sub">These routes are available:</p>
322 <ul class="routes">${list}</ul>
323 <p class="foot">Add a file under <code>pages/</code> to create a new route.</p>`;
324 return page("404 \u2014 Apex JS", body);
328async function startDevServer(options) {
329 const port = options.port ?? 3e3;
330 const pageId = options.pageId ?? "/pages/index.alpine";
331 const req = createRequire(import.meta.url);
332 const tryResolve = (spec) => {
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/server-AV533LKD.jsView on unpkg · L330 334 return req.resolve(spec);
339 const alpine = tryResolve("alpinejs");
340 const kit = tryResolve("@apex-stack/kit");
341 const coreClient = fileURLToPath(new URL("./client.js", import.meta.url));
342 const coreSelf = fileURLToPath(new URL("./index.js", import.meta.url));
344 "@apex-stack/core/client": coreClient,
345 "@apex-stack/core": coreSelf
347 if (alpine) alias.alpinejs = alpine;
348 if (kit) alias["@apex-stack/kit"] = kit;
349 const plugins = [apex({ clientRuntime: "@apex-stack/core/client" })];
350 let hasTailwind = false;