/rest-rand-api

REST API for random number generation and retrieveing results by ID.

Primary LanguagePHPMIT LicenseMIT

Random number REST

REST API for random number generation and retrieveing results by ID.

Install

Clone this repository and install dependencies:

composer install

Usage

Start local server:

php -S localhost:5555 -t public 

Generate random number:

curl -v localhost:5555/generate

OR

curl -v -X POST localhost:5555/generate

Retrieve result by ID:

curl -v localhost:5555/retrieve/<ID>

API responses in JSON.

You can also open localhost:5555 in browser and use GUI.