The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Namespace from "alchemy/Namespace"; |
| 2 | import { makeFrameworkSite, type FrameworkSiteProps } from "./FrameworkSite.ts"; |
| 3 | |
| 4 | /** The framework-integration package that drives the Octane build. */ |
| 5 | export const OCTANE_FRAMEWORK_SPECIFIER = "@alchemy.run/frontend-frameworks/octane"; |
| 6 | |
| 7 | /** The Node container deploy target for the Octane build. */ |
| 8 | export const OCTANE_NODE_TARGET_SPECIFIER = "@alchemy.run/frontend-frameworks/octane/node"; |
| 9 | |
| 10 | export interface OctaneProps extends FrameworkSiteProps {} |
| 11 | |
| 12 | /** |
| 13 | * Deploy an [OctaneJS](https://octanejs.dev) application to Railway: |
| 14 | * Octane's SSR server plus client assets on one `Railway.Service`. |
| 15 | * |
| 16 | * `Railway.Website.Octane` selects hosting and automatically wraps Octane's |
| 17 | * default native Node output. Keep compiler and route settings in |
| 18 | * `octane.config.ts` without an adapter. The legacy Node marker adapter |
| 19 | * remains optional for existing projects. |
| 20 | * |
| 21 | * During `alchemy dev` the site is Octane/Vite's own dev server and no |
| 22 | * cloud resources are created. `Alchemy.remote()` opts back into the live |
| 23 | * Service path. |
| 24 | * |
| 25 | * ### Creating Octane Sites |
| 26 | * **Example:** Basic Octane App |
| 27 | * ```typescript |
| 28 | * const site = yield* Railway.Website.Octane("Web", { |
| 29 | * rootDir: "./app", |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * ### Server Configuration |
| 34 | * **Example:** Process Environment |
| 35 | * ```typescript |
| 36 | * const site = yield* Railway.Website.Octane("Web", { |
| 37 | * rootDir: "./app", |
| 38 | * env: { |
| 39 | * API_BASE: "https://api.example.com", |
| 40 | * }, |
| 41 | * }); |
| 42 | * ``` |
| 43 | * |
| 44 | * @resource |
| 45 | * @product Website |
| 46 | */ |
| 47 | export const Octane = (id: string, props: OctaneProps = {}) => |
| 48 | makeFrameworkSite(id, props, { |
| 49 | name: "Octane", |
| 50 | framework: OCTANE_FRAMEWORK_SPECIFIER, |
| 51 | target: OCTANE_NODE_TARGET_SPECIFIER, |
| 52 | }).pipe(Namespace.push(id)); |