Getting Started Tutorial
Build your first Nyx application step by step.
Step 1: Project Initialization
nyx init my-first-app
cd my-first-app
Step 2: A Web Server
import std.http
fn main() {
let router = http.new_router()
router.route(http.GET, "/", |req| {
http.Response{ status: 200, body: http.Body.Text("Hello!") }
})
http.serve(":8080", router.handler()).unwrap()
}
Step 3: Build for Different Targets
nyx build # native desktop binary
nyx build --target wasm # web browser
nyx build --target ios # iPhone app