When you load your app, you're presumably going to the /
route. When using a browser to visit a page, a GET
request is sent. Since the /
route only allows POST
requests, Flask returns an error.
POST requests are used when data needs to be sent to the server. See the corresponding MDN page for more information
Since no processing of user data is done in the main
function, remove methods=["POST"]
from its decorator. This will set the allowed methods to GET. (see Flask Docs)