Skip to content
Snippets Groups Projects
Commit 28e38cf7 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

add: root path behavior

parent 60baeb18
No related branches found
No related tags found
No related merge requests found
...@@ -25,9 +25,11 @@ except Exception as e: ...@@ -25,9 +25,11 @@ except Exception as e:
# Define HTTP class # Define HTTP class
class IceHTTP(BaseHTTPRequestHandler): class IceHTTP(BaseHTTPRequestHandler):
def do_GET(self): def do_GET(self):
if self.path == '/':
self.send_response(200) self.send_response(200)
self.send_header("Content-type", "text/plain") self.send_header("Content-type", "text/plain")
self.end_headers() self.end_headers()
self.wfile.write(b"Root path hit!")
# Start a server on port 8443 using defined HTTP class # Start a server on port 8443 using defined HTTP class
if __name__ == "__main__": if __name__ == "__main__":
...@@ -53,16 +55,3 @@ def on_termination(): ...@@ -53,16 +55,3 @@ def on_termination():
# Register the function to be called on exit # Register the function to be called on exit
atexit.register(on_termination) atexit.register(on_termination)
\ No newline at end of file
# Default path
@app.route('/')
def default():
print("Default path hit!")
return "Return in default path"
# Test path
@app.route('/test', methods=['GET', 'POST'])
def test():
print("Test path hit!")
return "Return in test path"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment