Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created June 24, 2022 02:09
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 rahulbanerjee26/b2f420394555d4682100567c31acf736 to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/b2f420394555d4682100567c31acf736 to your computer and use it in GitHub Desktop.
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