DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,155 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Ega Prasetya
Ega Prasetya

Posted on

Golang Web - REST API With Mux

So today i gonna show you how to create RestApi With mux in Go. So let`s do it..

PRACTICE

First step u should to import package like a picture, u should to download package mux with go get -u github.com/gorilla/mux

Alt Text

So next create function main and then create code for the CRUD

Alt Text

if u done, create 5 function for handler CRUD

Alt Text

Alt Text

So next create struct Book and Author Struct for CRUD data

Alt Text

TESTING

i use POSTMAN for the testing this API

Alt Text

So here we go, Finally! Hope your enjoy it.

Top comments (0)

Update Your DEV Experience Level:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›