Karatan is a template/sample/skeleton/boilerplate web framework implemented in Rust using Actix Web. Initially to makes my life easy. It contains simple sample to start your own backend system. Is it performant? I am not sure since I am still learning Rust as well.
- Rust
- Clone the repo and go to the project directory.
- Type
cargo build
and thencargo run
to run the program. - It will run the web server on port
8000
, try at http://localhost:8000. - Then you can try several available sample routes below while reading the source code.
- (GET) / => Return string "Hello, World!"
- (GET) /about => Return string "This is about page"
- (POST) /upload => Imaginary path for POST end-point, still unimplemented
- (GET) /json => Return JSON data from static string
- (GET) /{name}/age/{age} => Return string with name and age from the URL
- (GET) /external/api/1 => Return JSON data from external API (https://jsonplaceholder.typicode.com/todos)
- (GET) /external/api/2 => Return JSON data from external hidden API with a bearer token
- The entry point file is on
src/main.rs
, for now that's single file and all logic is all there, no include files for easy to learn.
MIT
Copyright © 2024 Sony Arianto Kurniawan <sony@sony-ak.com> and contributors.