Skip to content

adhir2099/GO-GIN-restApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO

👋 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

    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 PR

Get in touch with me:

adhir2099

Created with ❤️ by Adhir2099