Created
November 23, 2022 17:25
-
-
Save carlosm27/1955e8c491c1769cec77195ab564e739 to your computer and use it in GitHub Desktop.
Get fruits handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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