Skip to content

Instantly share code, notes, and snippets.

@jimbeck
Created July 29, 2023 04:08
Show Gist options
  • Save jimbeck/553a1da0f1b868cefcf083fa5bc2a29d to your computer and use it in GitHub Desktop.
Save jimbeck/553a1da0f1b868cefcf083fa5bc2a29d to your computer and use it in GitHub Desktop.
firebase function post not working
@app.post("/vtt")
def createVtt() -> https_fn.Response:
if request.method == "POST":
print("POST")
if request.method == "GET":
print("GET")
return https_fn.Response("Worked")
# OR without flask
@https_fn.on_request(
cors=options.CorsOptions(
cors_origins=["*"],
cors_methods=["get", "post"],
),
)
def createVtt(request: https_fn.Request) -> https_fn.Response:
if request.method == "POST":
print("POST")
if request.method == "GET":
print("GET")
return https_fn.Response("Worked")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment