- Create folder inside
GOPATH/scr
- Create folder named rest-crud
- Project and dependencies initialization inside rest-crud folder
- MySQL Database:
go get github.com/go-sql-driver/mysql
- Mux Router:
go get github.com/gorilla/mux
- MySQL Database:
- Create main.go to set router and server
- Create mysql.go to configure database
- Create model.go to set data structure
- Create user.go to make function for each route
- Run project
go build
rest-crud.exe
- Test using postman (post, put, delete type use x-www-form-urlencoded)
-
Notifications
You must be signed in to change notification settings - Fork 0
indahmustika/golang-restapi
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple Create Update Delete
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published