Configuration
Fulgur is designed to work with zero configuration. When you need to customize behavior, options are available at two levels.
Vite plugin options
Pass options to the fulgur() plugin in vite.config.ts:
ts
import fulgur from "fulgur/vite";
export default defineConfig({
plugins: [
fulgur({
entry: "src/route.server.ts",
port: 3000,
}),
],
});| Option | Type | Default | Description |
|---|---|---|---|
entry | string | "src/route.server.ts" | Path to the server entry file, relative to the project root |
port | number | 3000 | Port for the backend server in development |
Environment variables
These can be set to override runtime behavior:
| Variable | Description |
|---|---|
FULGUR_PORT | Override the backend port (dev and production) |
FULGUR_ENTRY | Override the server entry path (set automatically by Fulgur) |
Vite dev proxy
Fulgur automatically configures a Vite dev proxy that forwards /api requests to the backend. This is handled transparently — no configuration needed.
Browser → localhost:5173/api/hello → Vite proxy → localhost:3000/helloServer file protection
Fulgur's Vite plugin blocks any runtime import of *.server.ts files from client code:
ts
import { something } from "./api/hello.server";
// ✗ Error: Cannot import server module in client codeType-only imports are allowed and stripped at build time:
ts
import type { App } from "../route.server";
// ✓ Safe — erased before bundling