This is a simple Golang web API that has a login API. The login API is very frugal and authenticates from a list of username and passwords passed in via environment variables. It listens on a configurable port and responds with a basic message. This application is intended to be deployed on platforms like Render, but it can be used locally for development and testing.
To get started with the Golang Web API, you'll need to have Go 1.18+ installed on your machine.
- Clone the repository:
git clone https://github.com/yourusername/golang-web-api.git cd golang-web-api
- Initialize Go modules
go mod tidy
- Set environment variables
USERS=<username:password comma separated for different ones>
- Build and run the application
go run main.go