Skip to content
 
 

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

EX01 Developing a Simple Webserver

Date:20.09.2025

AIM:

To develop a simple webserver to serve html pages and display the configuration details of laptop.

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:


content='''<!doctype html>
<html>
<head>
<title>Laptop Configuration</title>
</head>
<body align="center"><h1>LAPTOP CONFIGURATION</h1>
<table border="5" align="center">
<tr>
    <th bgcolor="grey">
        LAPTOP CONFIGURATION
    </th>
    <th bgcolor="grey">
        DESCRIPTION
    </th>
<tr>
    <td>
        Device Name
    </td>
    <td>
        DESKTOP-TAMIZHAN
    </td>
</tr>
<tr>
    <td>
        Processor
    </td>
    <td>
        12th Gen Intel(R) Core(TM) i5-1235U   1.30 GHz
    </td>
<tr>
    <td>
        Installed RAM
    </td>
    <td>
        16.0 GB (15.7 GB usable)
    </td>
</tr>
<tr>
    <td>
        Device ID
    </td>
    <td>
        15EEA3B2-7EF5-4DEC-903D-577382C3C005
    </td>
</tr>
<tr>
    <td>
        Product ID
    </td>
    <td>
        00342-42648-28891-AAOEM
    </td>
</tr>
<tr>
    <td>
        System Type
    </td>
    <td>64-bit operating system, x64-based processor</td>
</tr>
</table>
</body>
</html>


'''
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 =('',8000)
httpd = HTTPServer(server_address,MyServer)
httpd.serve_forever()

OUTPUT:

alt text

alt text

RESULT:

The program for implementing simple webserver is executed successfully.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages