Make sure Rust toolchains (i.e. rustup) are installed.
Next, run cargo install hotaru. The console should show this when it completes:
Finished release profile [optimized] target(s) in xx.xxs
Installing /home/<user>/.cargo/bin/hotaru
Installed package hotaru v0.8.3 (executable hotaru)
Next, add hotaru to PATH for easier access.
setx PATH "%PATH%;C:\User\<username>\.cargo\bin\hotaru
export PATH="/home/<username>/.cargo/bin/:$PATH"
Create an app:
hotaru new example
Then run it:
cd example
cargo run
Open an IDE of your choice, and start developing!
Start file:
use hotaru::prelude::*;
use hotaru::http::*;
#[tokio::main]
async fn main() {
APP.clone().run().await;
}
LServer!(
APP = Server::new()
.binding("127.0.0.1:3003")
.single_protocol(ProtocolBuilder::new(HTTP::server(HttpSafety::default())))
.build()
);
endpoint!{
APP.url("/"),
/// Hello world function
pub hello_world <HTTP> {
text_response("Hello, world!")
}
}
mod resource;