Getting Started
Install Harbor and run your first program in under a minute.
Prerequisites
Harbor is built with Rust. You'll need the Rust toolchain installed to compile Harbor from source.
- Rust (1.70 or later)
- Git
Installation
Clone the repository and build with Cargo:
git clone https://github.com/gradykorchinski-ship-it/Harbor.git
cd Harbor
cargo build --release
The compiled binary will be at target/release/harbor. You can
move it to a directory on your PATH:
cp target/release/harbor ~/.local/bin/ Your first program
Create a file called hello.hb:
greeting = "Hello from Harbor!"
print(greeting) Run it:
cargo run Note: Harbor currently reads from main.hb
in the project root by default. Rename your file to main.hb
or check the source for the expected file path.
You should see:
Hello from Harbor! Your first server
Replace the contents of main.hb with:
server 8080 {
get "/hello" {
respond "Hello, world!"
}
} Run the program:
cargo run You'll see:
Harbor server running on http://127.0.0.1:8080 Open http://127.0.0.1:8080/hello in your browser or use curl:
curl http://127.0.0.1:8080/hello The response will be:
Hello, world! Project structure
A Harbor project is a single .hb file. There's no package manager, no configuration, and no directory structure to set up.
my-project/
main.hb That's it.