Coder Social home page Coder Social logo

rock-api's Issues

There was a frog in the API.

Describe the bug
The API is supposed to send you a picture of a rock. There was a frog.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://mrconos.pythonanywhere.com/rock/random
  2. Constantly reload until you get something like {"name": "frogg", "desc": "Definitely a rock.", "image": "https://tinyimg.io/i/VRWsyTb.png", "rating": 4}.

Expected behavior
There should be no frog.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Microsoft Windows 10 Home 10.0.19043 Build 19043
  • Browser: 101.0.4951.67 (Official Build) (64-bit) (cohort: Stable)

[Workflow Suggestion] Formatting with `black`

I suggest using the black formatter (pip install black) for this project.

Motive

black is an unforgiving formatter, that meaning it's extremely consistent with it's guidelines. I think this consistency in style would be appreciated by other developers working on this project.

Installation

$ pip install black
or
$ python3 -m pip install black

Usage

$ black .
or
$ python3 -m black .

Externals

https://github.com/psf/black
https://pypi.org/project/black/

API Structure

Resource

Why not use FastAPI to create the API? FastAPI offers more resources.

Build

Moreover, the architecture of this project can be better

Rock-API
│   README.md 
│
└───api
│   │   main.py   
└───tests
    │   test1.py
    │   test2.py

And the architecture of the API itself can be improved too

mrconos.pythonanywhere.com/rock

  • /post - upload a new rock
  • /random - get a random rock from the API
  • /get - get a specific rock by name/ID

Other features that can be added

  • An unique ID for every rock
  • Search for rocks
  • Rocks upload and receive by base64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.