Question · Python course · Module 6: Async and FastAPI

Endpoint decorator

How do you define a GET endpoint in FastAPI?

Answer options

  • @endpoint.get('/path')
  • @app.route('/path', methods=['GET'])
  • @get('/path')
  • @app.get('/path')

You can check the correct answer by solving this task in the CodeWorlds game.