This is a simple web server developed with python sockets. Server is compatible of serving various file types and also supports serving multiple clients at once.
The server also support simple GET and POST form submissions.
| Type | Route |
|---|---|
| .html | / |
| .php | /contact.php |
| .css | /style.css |
| .js | /script.js |
| .jpg | /images/parallax1.jpg |
| .json | /files/sample.json |
| .xml | /files/sample.xml |
| .txt | /files/sample.txt |
| /files/sample.pdf | |
| .xlsx | /files/sample.xlsx |
- PHP 8.2.4 or up (
php -vfor version ) - Python3 (
python -vfor version ) - NodeJs (
node -vfor version ) [ optional ]
Create a folder named as htdocs in the root directory, and add the web files to it.
Than, to start the server, Run the below code.
python serve.pyFor Development
If you have NodeJs installed, use npm and nodemon to start the server.
npm install # install node modulesTo run the server
npm start # run the servernpm run dev # run the server in development modeNow open the browser and head over to localhost:2728.