Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Importing the required libraries
from datetime import datetime
from os import environ
from typing import Optional
from sys import exit as sys_exit
from typing import Optional

from flask import Flask, jsonify, render_template, request

Expand Down Expand Up @@ -76,7 +76,8 @@ def func1():
return jsonify({"Datetime": datetime.now(), "Error": "Method not allowed"}), 405


@app.route("/users/<string:doc_id>", methods=["GET", "PUT", "DELETE"]) # type: ignore
# type: ignore
@app.route("/users/<string:doc_id>", methods=["GET", "PUT", "DELETE"])
def func2(doc_id: str):
"""Function to handle GET, PUT and DELETE requests on /users/<string:doc_id> route"""
if request.method == "GET":
Expand Down