Skip to content
betterstack-alchemyUnofficial

Cloud.Website.SolidStart

Kind Composite (deploys several resources)Source src/Cloud/Website/SolidStart.ts

Deploy a SolidStart application to a Better Stack Cloud server: the SSR server as a systemd unit on port 3000, static assets (prerendered pages included) baked into the unit.

The build runs through @alchemy.run/frontend-frameworks/solidstart with the @alchemy.run/frontend-frameworks/solidstart/node deploy target — both must be installed in your project, alongside @solidjs/start and @solidjs/vite-plugin-nitro-2.

Your vite.config.ts needs no adapter wiring: the integration drives the project’s own vite build and appends its own nitro plugin instance carrying nitro’s node preset.

Basic SolidStart App

const site = yield* BetterStack.Cloud.Website.SolidStart("Web", {
rootDir: "./app",
});

Custom Domain

const site = yield* BetterStack.Cloud.Website.SolidStart("Web", {
rootDir: "./app",
// Better Stack has no DNS: the A record goes to Cloudflare.
domain: { name: "app.example.com", dns: Cloudflare.DNS.Adapter() },
});

Process Environment

const site = yield* BetterStack.Cloud.Website.SolidStart("Web", {
rootDir: "./app",
env: {
API_BASE: "https://api.example.com",
},
});

The integration owns the nitro plugin instance (a nitroV2Plugin() in your vite.config.* is rejected), so nitro options — prerendering included — go on the nitro prop. Prerendered pages are baked into the unit and served as static assets.

Prerender Routes

const site = yield* BetterStack.Cloud.Website.SolidStart("Web", {
rootDir: "./app",
nitro: { prerender: { routes: ["/", "/about"] } },
});

The site runs as one Cloud.Service (a systemd unit, port 3000, gated on the serve entry’s GET /health) on a Cloud.Server. Without server, the composite creates a billable server: AM1 (the smallest type) on ubuntu-26-04, term monthly. Pass server to use one you already have (one website per server), and firewall when that server has a Cloud.Firewall (port 3000 is opened on it). domain publishes an A record through another provider’s DNS adapter (Better Stack has no DNS); the site speaks plain HTTP on 3000, and HTTPS is a Cloud.LoadBalancer + managed Cloud.Certificate in front (see StaticSite). No CDN: the object cache only fronts S3-compatible buckets for SigV4 clients, so the unit serves its own assets. See FrameworkSiteProps.

assets WebsiteAssetsProps

Static-asset routing (notFoundHandling, htmlHandling).

dev { mode?: "server" | undefined; host?: string | undefined; port?: number | undefined; strictPort?: boolean | undefined; } | { mode: "external"; url?: string | u…

Options for the local dev server that runs this site under alchemy dev.

domain string | { name: string; dns?: DnsConfig<string> | undefined; }

Optional custom domain pointed at the server's public IPv4 through a DNS adapter: { name: "app.example.com", dns: Cloudflare.DNS.Adapter() }. The site url becomes http://{domain}:3000 (no TLS on the Service; for HTTPS put a Cloud.LoadBalancer with a Cloud.Certificate in front). A plain string fails with WebsiteDomainError: Better Stack has no DNS zone to create the record in.

env Record<string, string | Redacted<string> | Output<string | undefined, any>>

Process environment for the hosted unit (and the local framework dev server). Accepts Outputs (e.g. VITE_API_URL: api.url) and Redacted secrets: those reach the unit at runtime only — written in clear text solely to its env file on the server (mode 600), shown (redacted) in the plan, kept inside the state store's redaction marker, and NOT passed to the deployed build (only plain values are).

firewall Firewall | Effect<Firewall, never, Providers>

A Cloud.Firewall the server has attached. A firewall admits only what its rules allow, so the composite adds an inbound TCP rule for port 3000 from anywhere (FirewallRule with logical id Port). Leave it out for a server without a firewall (every port is reachable).

memo boolean | MemoOptions

Controls which files are hashed to decide whether the build re-runs. Default: true.

nitro Record<string, unknown>

Nitro options forwarded into the nitro plugin the integration appends (prerendering, route rules, storage, ...). preset is owned by the Node deploy target and may not be set here. JSON-serializable values only — no functions or plugin instances. This is a prop (rather than project config) because the integration owns the nitro plugin instance: a nitroV2Plugin() in your project's vite.config.* is rejected, so this prop is the one home for nitro options — and it accepts values derived from other resources' Outputs, which a config file cannot.

rootDir string

Project root directory (the directory containing package.json). Default: ".".

server Server | Effect<Server, never, Providers>

Server the site's Service runs on: a Cloud.Server or an Effect that produces one. The server must carry Alchemy's deploy key (the default bootstrap: true). When omitted, the composite creates a billable server: AM1 (the smallest type) on ubuntu-26-04, term monthly, in the credentials' availability zone. Several sites (and Services) can share one server: each is its own systemd unit, but they all listen on port 3000, so only one website fits per server.

tags Record<string, string>

Your own tags, set as the metadata of the server the composite creates (at most 10). Ignored when server is given.