25 lines
566 B
Go
25 lines
566 B
Go
package routers
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"health-go/handlers"
|
|
)
|
|
|
|
func SetupRouter() *gin.Engine {
|
|
r := gin.Default()
|
|
|
|
// user
|
|
r.GET("/", handlers.TestPage)
|
|
r.GET("/firstUser", handlers.FirstUser)
|
|
|
|
// record
|
|
r.GET("/fetchHosList", handlers.FetchHospitalList)
|
|
r.GET("/fetchAllRec", handlers.FetchAllRecords)
|
|
|
|
// hospital
|
|
r.POST("/api/addHos", handlers.AddHospital) // add hospital
|
|
r.POST("/api/modifyHos", handlers.ModifyHospital) // modify hospital
|
|
r.DELETE("/api/deleteHos", handlers.DeleteHospital) // delete hospital
|
|
return r
|
|
}
|