Created
June 24, 2022 02:09
-
-
Save rahulbanerjee26/b2f420394555d4682100567c31acf736 to your computer and use it in GitHub Desktop.
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 replit import db | |
import request | |
@app.route('/user', methods=['GET', 'POST']) | |
def user(): | |
# GET Request | |
if request.method == 'GET': | |
users = [] | |
for key in db.keys(): | |
users.append({'name': key, 'number': db[key]}) | |
return {'data': users}, 200 | |
else: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment