A lightweight HTTP API that provides random numbers.
Use the publicly available instance or run your own instance.
Returns a random number between the lower and upper bound.
GET /number?min=<LOWER_BOUND>&max=<UPPER_BOUND>
# E.g.:
curl -X GET 'rnd.is/number?min=1&max=404'
Returns:
{
"apiVersion": "0.3.1",
"params": {
"min": 1,
"max": 404
},
"data": {
"kind": "number",
"value": 327
}
}
Returns an array of random numbers between the lower and upper bound.
GET /number?length=<LENGTH>&min=<LOWER_BOUND>&max=<UPPER_BOUND>
# E.g.:
curl -X GET 'rnd.is/numbers?length=3&min=1&max=404'
Returns:
{
"apiVersion": "0.3.1",
"params": {
"min": 1,
"max": 404,
"length": 3
},
"data": {
"kind": "number",
"value": [
304,
139,
56
]
}
}
Returns an uuid.
GET /uuid
# E.g.:
curl -X GET 'rnd.is/uuid'
Returns:
{
"apiVersion": "0.3.1",
"params": null,
"data": {
"kind": "string",
"value": "08e54ac3-e661-44ee-88b1-09a6afcb34b4"
}
}
To start the API locally you'll need to set the var PORT
, e.g. export PORT=8080
.
Afterwards run:
cargo run --package rnd_is --bin rnd_is
To execute all tests run:
cargo test