Rest API using Go's Gin! and gorilla mux
- Gorilla mux
- Gorm
- Gin
- MySQL driver
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
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
- Fork it!
- Create your feature branch:
git checkout -b your-branch
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin your-branch
- Submit a PR
Created with ❤️ by Adhir2099