GitXplorerGitXplorer
p

colors

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
5d9d04628b344594652b78c390a4d99b1f56e6aa

Fix typos in README.md

ppawelkopka committed 3 years ago
Unverified
a0de3bbedb9fa84a1065c33fb8e853d8a68fa37f

Add REST: api colors

ppawelkopka committed 3 years ago

README

The README file for this repository.

Colors

API that serves colors from provided json file.

Requirements

  • podman
  • tox
  • curl

How to run

Build image

podman build . --tag colors:v0.1.0

Run App

podman run --rm -p 5000:5000 -v /home/kepok/redhat/colors/colors.json:/colors/cols.json:rw colors:v0.1.0 --name colors

Open browsers or curl http://localhost:5000/colors

How to use

Get full colors list

curl http://localhost:5000/colors

Get color

curl http://localhost:5000/blue

Post color

curl -X POST http://localhost:5000/pink -d "#FFC0CB"

with ## How to run tests Tox install dependency and run pytest and black

tox

Assumptions

  • Use file to persistence data
  • File loaded as volume to a container
  • Use python 3.8
  • Response with json
  • Post with data
  • Post can overwrite

What can be improved

  • use database instead of file