Go Simple HTTP Server is a lightweight HTTP server built with Go (Golang). It is designed to be easy to use and extend, providing a simple way to handle HTTP requests and responses. This project serves as a foundation for building RESTful APIs and web applications.
- Lightweight and easy to set up
- Supports middleware for request handling
- Configurable logging using Logrus
- Graceful shutdown on interrupt signals
To get started with the Go Simple HTTP Server, follow these steps:
-
Clone the repository:
git clone https://github.com/ralvescosta/go-simple-http-server.git cd go-simple-http-server
-
Install dependencies: Make sure you have Go installed on your machine. Then, run:
go mod tidy
-
Run the server: You can start the server by running:
go run main.go
Once the server is running, you can access it at http://localhost:3333
. You can customize the port and other configurations through environment variables.
The project is organized as follows:
go-simple-http-server/
├── main.go # Entry point of the application
├── pkg/ # Contains application packages
| ├── configs # Env Vars configs
│ ├── controllers/ # HTTP request handlers
│ ├── routes/ # Route definitions
│ ├── services/ # Business logic and services
│ └── logger/ # Logging setup and configuration
├── internal/ # Internal application code
│ ├── models/ # Data models
│ └── services/ # Business logic
│
├── properties.local.json # Local configuration file
└── README.md # Project documentation
Contributions are welcome! If you would like to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.