MounishT / simplewebserver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EX01 Developing a Simple Webserver

AIM:

To develop a simple webserver to serve html pages.

DESIGN STEPS:

Step 1:

HTML content creation

Step 2:

Design of webserver workflow

Step 3:

Implementation using Python code

Step 4:

Serving the HTML pages.

Step 5:

Testing the webserver

PROGRAM:

'''

from http.server import HTTPServer,BaseHTTPRequestHandler content=''' <!doctype html>

<title> My Web Server</title>

Top Five Web Application Development Frameworks

1.Django

2. MEAN Stack

3. React

4. MERN

5. Angular

'''

class MyServer(BaseHTTPRequestHandler): def do_GET(self): print("Get request received...") self.send_response(200) self.send_header("content-type", "text/html")
self.end_headers() self.wfile.write(content.encode())

print("This is my webserver") server_address =('',80) httpd = HTTPServer(server_address,MyServer) httpd.serve_forever() '''

OUTPUT:

OUTPUT OUTPUT

RESULT:

The program for implementing simple webserver is executed successfully.

About


Languages

Language:Python 100.0%