Skip to content

andrewlively/micro-random-number-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micro-random-number-service

Microservice which returns a random number using micro and Math.random().

An example is running at: https://micro-random-number-service-pmgghnftey.now.sh

Dependencies

  1. Node.js 8.1.2+

Installation

  1. Clone this repo
git clone https://github.com/andrewlively/micro-random-number-service && cd micro-random-number-service
  1. Install dependencies
npm install
  1. Start!
# This will start the microservice running on port 3000

npm start

Parameters

You can include optional parameters with your request through the querystring:

  • min (Default: 1)
  • max (Default: 5)

Examples

Default

curl https://micro-random-number-service-pmgghnftey.now.sh
{
  "number": 5
}

With Parameters

# Number between 10 and 100

curl -L "https://micro-random-number-service-pmgghnftey.now.sh?min=10&max=100"
{
  "number": 49
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published