Welcome to my Go (Golang) project! In this project, I developed a HTTP server, which processes incoming requests and includes a graceful shutdown mechanism. The project is hosted on AWS using Elastic Beanstalk for easy scaling and management. This was a fantastic learning experience where I got hands-on with Go, AWS services, and web application deployment.
- HTTP Server: Handles GET requests and responds with a message.
- Graceful Shutdown: Proper handling of shutdown signals for a smooth server stop.
- AWS Deployment: Deployed on AWS Elastic Beanstalk for scalability and management.
- Go (Golang): Backend programming language.
- AWS Elastic Beanstalk: For deployment, load balancing, and auto-scaling.
- AWS EC2: Virtual servers to run the application.
- SQLite: Managed relational database service for data persistence.
- AWS CloudWatch: For monitoring application logs and health checks.
- Go: You need Go installed on your local machine. You can download it from here.
- AWS CLI: To interact with AWS from the command line, you'll need the AWS CLI installed. Follow the AWS CLI installation guide.
- Elastic Beanstalk CLI: Install the AWS Elastic Beanstalk CLI. You can follow the installation steps here.
-
Clone the repository to your local machine:
git clone https://github.com/your-username/golang-first-project.git cd golang-first-project
-
Make sure you have Go installed:
go version
-
Install dependencies:
go mod tidy
-
Run the application locally:
go run main.go -config config/local.yaml
This should start the server locally at
localhost:8080
.
- HTTP GET handler: Responds to requests at
/
with a simple message. - Graceful Shutdown: Handles system shutdown signals (
SIGINT
,SIGTERM
) gracefully. - AWS Deployment: Automatically scales the application based on demand.
-
Port already in use: If you encounter the "address already in use" error, ensure that no other process is using port 8080 by running:
lsof -i :8080
You can kill the process using:
kill -9 <PID>
-
Deployment issues on AWS: Make sure the Elastic Beanstalk CLI is correctly configured and the AWS environment is properly set up.
If you'd like to contribute to this project, feel free to fork the repository, submit a pull request, or open an issue for feedback. All contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.