Hi! This is a simple web server I whipped up with C#. It's all about serving basic website files (HTML, CSS, JS) from a local webroot folder directly to a browser.
- Serves your static web files (
.html,.css,.js) when a browser asks (using GET). - Listens on port 8080 for connections.
- Can chat with a few browsers at once.
- Sends simple error pages if a file is missing (404), the request method is wrong (405), or if access isn't allowed (403).
- Keeps files secure by only looking inside the
webrootfolder.
Program.cs: The main code for the server.webroot/: Put your website files here!
- Build: Use the .NET SDK to build the project (
dotnet build). - Run: Execute the program from its output folder (e.g.,
dotnet WebServer.dll). - View: Open
http://localhost:8080/in your browser.