What is the primary purpose of Flask's route() decorator?

  • To create a new route in the server
  • To define a URL endpoint for a function
  • To restrict access to a route
  • To specify a route's HTTP methods
The primary purpose of Flask's route() decorator is to define a URL endpoint for a Python function. It associates a function with a specific URL path, allowing it to handle incoming HTTP requests to that path.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *