This project demonstrates how to build a modular web server in Go with separate packages for server implementations (net/http
, Gin, Echo) and reusable middleware (e.g., logging).
- Multiple Servers: Easily switch between
net/http
, Gin, and Echo web servers. - Modular Design: Separate
servers
andmiddleware
packages for maintainability and scalability. - Custom Middleware: Reusable logging middleware applied across different server frameworks.
Run the desired server by passing the server type as a command-line argument:
-
Run
net/http
Server:go run main.go nethttp
-
Run
gin
Server:go run main.go gin
-
Run
echo
Server:go run main.go echo
-
Run
fiber
Server:go run main.go fiber