-
Notifications
You must be signed in to change notification settings - Fork 0
API Routes (.api.x.py)
Sarthak Ghoshal edited this page May 23, 2025
·
1 revision
use these for backend apis, they use flask
method = ['GET']
def handler(req, res, json):
response = res("Cookie set!")
response.set_cookie("vip", "yes")
return response- method = type of https method (get, post, put, delete)
- handler = main function of the API route
- req = flask's request
- res = flask's make_response
- json = flask's jsonify