Skip to content

API Routes (.api.x.py)

Sarthak Ghoshal edited this page May 23, 2025 · 1 revision

API Routes (.api.x.py)

use these for backend apis, they use flask

Syntax:

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

Clone this wiki locally