Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adhir2099/go-gin-restapi
Go Rest API using Gin
https://github.com/adhir2099/go-gin-restapi
api-rest gin go golang gorilla-mux gorm mysql
Last synced: about 1 month ago
JSON representation
Go Rest API using Gin
- Host: GitHub
- URL: https://github.com/adhir2099/go-gin-restapi
- Owner: adhir2099
- Created: 2023-11-23T20:10:15.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-09T16:09:55.000Z (about 1 year ago)
- Last Synced: 2023-12-09T17:25:09.644Z (about 1 year ago)
- Topics: api-rest, gin, go, golang, gorilla-mux, gorm, mysql
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![GO](https://img.shields.io/badge/GO-47d1ed?style=for-the-badge&logo=go&logoColor=white)
👋 GO-GIN REST API
# GO-GIN REST API
Rest API using Go's Gin! and gorilla mux## Backend
## Included imports
* Gorilla mux
* Gorm
* Gin
* MySQL driver## Initialize
Initialize Go's API
Get to the directory
Configure your server you want to listen, by default is in 8080
go run main.go
Running migration
go run migration/migrate.go
If you add more fields to the model, you have to update the controller as well
DB connection
```go
dsn := "user:@password/database?charset=utf8mb4&parseTime=True&loc=Local"
```
If you're not using any password just leave it this way:@/database
Testing insomnia/postman/thunder client
localhost:8080/api/v1/users
GET(getById)/PUT/DELETE : localhost:8080/api/v1/users/:id
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b your-branch`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin your-branch`
5. Submit a PRGet in touch with me:
Created with ❤️ by Adhir2099