Microservice which returns a random number using micro and Math.random().
An example is running at: https://micro-random-number-service-pmgghnftey.now.sh
- Clone this repo
git clone https://github.com/andrewlively/micro-random-number-service && cd micro-random-number-service
- Install dependencies
npm install
- Start!
# This will start the microservice running on port 3000
npm start
You can include optional parameters with your request through the querystring:
- min (Default: 1)
- max (Default: 5)
curl https://micro-random-number-service-pmgghnftey.now.sh
{
"number": 5
}
# Number between 10 and 100
curl -L "https://micro-random-number-service-pmgghnftey.now.sh?min=10&max=100"
{
"number": 49
}