Spaces:
Configuration error
Configuration error
Update README.md
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071# Golang API BoilerplateThis is a boilerplate for a RESTful API written in Golang.## Features- [x] JWT Authentication- [x] PostgreSQL Database- [x] GORM ORM- [x] Gin Framework- [x] Docker Support- [x] Environment Variables- [x] Logging- [x] Error Handling## Getting Started1. Clone the repository2. Run `go get` to download the dependencies3. Create a file named `.env` and add the following variables:* `DB_HOST`* `DB_USER`* `DB_PASSWORD`* `DB_NAME`* `DB_PORT`* `SALT`* `HOST_ADDRESS`* `HOST_PORT`* `LOG_PATH`4. Run `go run main.go` to start the server5. Open your browser and navigate to `http://localhost:HOST_PORT`## API Endpoints### Authentication- `POST /login`: Login with email and password- `POST /register`: Register a new user- `GET /logout`: Logout### Users- `GET /users`: Get all users- `GET /users/:id`: Get a user by ID- `PUT /users/:id`: Update a user- `DELETE /users/:id`: Delete a user## Docker SupportYou can build a Docker image by running `docker build -t my-api .` and then run it with `docker run -p 8080:8080 my-api`.## Environment VariablesYou can set the following environment variables:- `DB_HOST`- `DB_USER`- `DB_PASSWORD`- `DB_NAME`- `DB_PORT`- `SALT`- `HOST_ADDRESS`- `HOST_PORT`- `LOG_PATH`## LoggingThe API uses the `log` package to log errors. You can set the `LOG_PATH` environment variable to specify the log file path.## Error HandlingThe API uses the `errors` package to handle errors. You can set the `ERROR_PATH` environment variable to specify the error file path.# Command Documentation## Update Golang Project version> go mod edit -go 1.24> go mod tidy## Update all package> go get -u ./...> go mod tidy12345678---title: Quzuu Api Devemoji: 🐠colorFrom: indigocolorTo: graysdk: dockerpinned: false---
README.md+8-71