Simple rust api example with Axum and mysql library Provides 3 api
Initialize your local database and use cargo run
to run the app
-
Hello World
curl http://localhost:3000/ Hello, world!
-
Random
curl http://localhost:3000/random\?start=5\&end=50 Random number
-
Employee (connecting to db)
curl http://localhost:3000/employee\?id=1 [Employee { id: 1, name: "Sauron" }]