Skip to content

Astro

Source: src/Railway/Website/Astro.ts

Deploy an Astro application to Railway: the Node SSR bundle (assets first, then the Astro fetch handler) on one Railway.Service. Pages render on demand by default (output: "server"); pages that export const prerender = true are prerendered at build time and served as static files. With astro: { output: "static" } every page is prerendered and the deploy is assets-only.

The build runs through @alchemy.run/frontend-frameworks/astro with the @alchemy.run/frontend-frameworks/astro/node deploy target (a Node adapter is injected — your astro.config.* must not declare one).

During alchemy dev the site is Astro’s own dev server and no cloud resources are created. Alchemy.remote() opts back into the live Service path.

const site = yield* Railway.Website.Astro("Web", {
rootDir: "./app",
});
const site = yield* Railway.Website.Astro("Docs", {
rootDir: "./docs",
astro: { output: "static" },
errorPage: "404.html",
});
const site = yield* Railway.Website.Astro("Web", {
rootDir: "./app",
env: {
API_BASE: "https://api.example.com",
},
});