Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Go Static Web Server

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.


✨ Features

  • ⚑ 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 Structure

project/
β”‚
β”œβ”€β”€ main.go
β”‚
└── static/
    β”œβ”€β”€ index.html
    β”œβ”€β”€ style.css
    └── script.js

πŸ› οΈ Requirements

  • Go 1.20 or newer

Check your Go version:

go version

▢️ Run the Project

Clone the repository:

git clone <YOUR_REPOSITORY_URL>

Go to the project folder:

cd project
cd P1
cd p1

Run the server:

go run main.go

🌍 Open in Your Browser

Visit:

http://localhost:8080/

πŸ”„ Change the Port

Open main.go and modify:

http.ListenAndServe(":8080", nil)

Example:

http.ListenAndServe(":3000", nil)

Then access:

http://localhost:3000/

πŸ“š Technologies Used

  • Go (Golang)
  • net/http
  • HTML5
  • CSS3
  • JavaScript

🎯 Learning Objectives

This project demonstrates:

  • Creating an HTTP server
  • Serving static files
  • Working with routes
  • Project organization
  • Local web development with Go

πŸš€ Future Improvements

  • Custom routing
  • Dynamic HTML templates
  • REST API support
  • Authentication
  • Logging and middleware
  • Docker support
  • HTTPS support
  • Environment configuration

πŸ“„ License

This project is available under the MIT License.


Built with ❀️ using Go

-----Naman.K.Y------

About

# πŸš€ Go Static Web Server A simple web server built with Go that serves static websites using Go's built-in `net/http` package. This project is designed to help beginners understand how web servers work while providing a clean foundation for building more advanced Go web applications.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages