Example API Gin Go With Postgree

Route

  • GET /student
  • GET /student/:studentId
  • POST /student (json data with student_id, student_name, student_age, student_address and student_phone_no attribute)
  • PUT /student/:studentId (json data with student_name, student_age, student_address and student_phone_no attribute)
  • DELETE /student/:studentId

How to run

  1. Import sql
  2. Setup db config in main.go
  3. go run main.go