Showing posts with the label gorilla/mux

Go Language, MYSQL - Simple Rest CRUD API example

In this article, we will show you how to develop a  REST-style web service with Go Language and MYSQL. These are APIs that Spring backend App will export: GET all User's        :   /users GET User by ID     :   /users/{id}  POST User             :   /users PUT User               :   /users DELETE User       :   /users/{id} Technologies used: Go Language MYSQL Database gorilla/mux jinzhu/gorm gorilla/mux:  The gorilla/mux package provides request routing, validation, and other services. jinzhu/gorm:  The gorm is an ORM library for the Go language.GORM provides CRUD operations and can also be used for the initial migration and creation of the database schema. Final Project Structure: Let's start building the application Create database 'userdb': CREATE DATABASE userdb; Initialize the Go project: Initialize the Go project  using the following command go mod init rest-crud-api-go-lang Adding the modules required for the project: go get go get github.c