'Converting a python3 http basic server to flask app
Id like to convert this server.py to a flask app, i got a basic flask app up and running, but i am confused on the first block of code here:
https://github.com/JPHutchins/pgesmd_self_access/blob/master/pgesmd_self_access/server.py
How could i write this if/else statement in flask?
def do_POST(self):
"""Download the ESPI XML and save to database."""
_LOGGER.debug(f"Received POST from {self.address_string()}")
if self.path == "/test":
self.send_response(200)
self.end_headers()
return
if not self.path == "/pgesmd":
return
what exactly is it doing or how can i convert it into two app routes?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
