Skip to content

Instantly share code, notes, and snippets.

@carlosm27
Created November 23, 2022 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosm27/1955e8c491c1769cec77195ab564e739 to your computer and use it in GitHub Desktop.
Save carlosm27/1955e8c491c1769cec77195ab564e739 to your computer and use it in GitHub Desktop.
Get fruits handler
from robyn import Robyn, jsonify, static_file
from helper import get_item
import json
app = Robyn(__file__)
fake_fruit_database = [
{"id":1, "fruit":"Apple"},
{"id":2, "fruit": "Orange"},
{"id":3, "fruit": "Pineapple"}
]
...
@app.get("/fruits")
def all_fruits(request):
return jsonify(fake_fruit_database)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment