A fast static site hosting platform with subdomain-based routing.
This project uses a workspace structure with the following packages:
packages/server- The main hosting server that serves static files from subdomainspackages/cli- Command-line interface for managing deployments
Install dependencies for all workspaces:
bun installTo run the server in development mode:
cd packages/server
bun run devThe server will start and listen for requests. Static files are served based on subdomain routing from the data/ directory.
To run the CLI in development mode:
cd packages/cli
bun run dev [command]cd packages/server
bun run buildcd packages/cli
bun run build-
Server: Serves static files from the
data/directory based on subdomain routingexample.localhostserves files fromdata/example/- Supports index.html fallback and SPA routing with 200.html
-
CLI: Manages deployments to the data directory
- Deploy sites to subdomains
- List, remove, and get info about deployed sites
Static files are stored in the data/ directory at the project root:
data/
├── example.com/
│ ├── index.html
│ └── assets/
└── another-site/
├── index.html
└── 200.html
This project was created using bun init and uses Bun as the JavaScript runtime.