Sign inSign up

inputobject2/random-picker

By inputobject2

Updated over 2 years ago

Picks a random choice out of a list of choices.

Image
0

1.7K

inputobject2/random-picker repository overview

Random Item Selector Web App

Overview

This is a simple web application to pick from a list of values. It allows users to input items into a list and then select one at random.

The web server runs on port 8080.

Note that there is no session management implemented, so refreshing the page will clear all entries.

Features

  • Add Items: Users can add items using a text input box.
  • Random Selection: Click a button to highlight a random item from the list.

Running with Docker

You can run the container this way:

docker run -p 8080:8080 inputobject2/random-picker

API Usage

There are two ways to use this randomizer. The first is to go on the web page directly with a web browser, type in your items and hit random. Refresh the page to clear it out.

The second is with the API by sending a POST with a json body to /random, the API will return a random object from the list you sent.

curl -X POST http://localhost:8080/random -d '{"items":["apple", "banana", "cherry"]}' -H "Content-Type: application/json"

Server responds with:

{
    "selectedItem":"banana"
}

Tag summary

Content type

Image

Digest

sha256:a6d7664f7

Size

7.6 MB

Last updated

over 2 years ago

docker pull inputobject2/random-picker