Skip to content
Snippets Groups Projects
Commit 8c725557 authored by Ferdinand Badu's avatar Ferdinand Badu
Browse files

backend for form in python

parent aab26103
Branches Form
No related tags found
1 merge request!1Form
from http.server import BaseHTTPRequestHandler, HTTPServer
class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(bytes("<html><head><title> Server for form </title></head>", "utf-8"))
self.wfile.write(bytes("<body>", "utf-8"))
self.wfile.write(bytes("<p>for for hackathon 2 ", "utf-8"))
self.wfile.write(bytes("</body></html>", "utf-8"))
if __name__ == "__main__":
webServer = HTTPServer(('localhost', 8080), MyServer)
print(" hackathon 2 local server started at port 8080")
try:
webServer.serve_forever()
except KeyboardInterrupt:
pass
webServer.server_close()
print("Server stopped.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment