A lightweight and beginner-friendly web server built with Go (Golang) that serves static websites using Go's built-in net/http package.
This project demonstrates how to host HTML, CSS, and JavaScript files locally with minimal code, making it a great starting point for learning backend development in Go.
- β‘ Fast HTTP server written in Go
- π Serves static HTML, CSS, and JavaScript files
- π Runs on localhost or any available port
- π§ Easy to customize and extend
- π¦ No external dependencies
- π Cross-platform support (Windows, Linux, macOS)
project/
β
βββ main.go
β
βββ static/
βββ index.html
βββ style.css
βββ script.js
- Go 1.20 or newer
Check your Go version:
go versionClone the repository:
git clone <YOUR_REPOSITORY_URL>Go to the project folder:
cd project
cd P1
cd p1Run the server:
go run main.goVisit:
http://localhost:8080/
Open main.go and modify:
http.ListenAndServe(":8080", nil)Example:
http.ListenAndServe(":3000", nil)Then access:
http://localhost:3000/
- Go (Golang)
- net/http
- HTML5
- CSS3
- JavaScript
This project demonstrates:
- Creating an HTTP server
- Serving static files
- Working with routes
- Project organization
- Local web development with Go
- Custom routing
- Dynamic HTML templates
- REST API support
- Authentication
- Logging and middleware
- Docker support
- HTTPS support
- Environment configuration
This project is available under the MIT License.
-----Naman.K.Y------