Building Golang Restful API with Echo framework

I am assuming go already installed in your system, If it’s not installed you can install and set the path I am providing the link here.

Follow the below steps one by one.

Step 1:- Check the go version & make the folder

Go version should be greater than v1.13 because the lower version doesn’t support some middlewares, Make sure your project folder is outside your $GOPATH.

Check to go version

Make folder

Step 2:- Create server.go file in the root directory.

Step 3:- Start the server

You can browse the http://localhost:1323 and see the web page.

Step 4:- Routing

Write this code inside the server.go file.

Now we will add one by one route codes with curl requests.

Route 1 -

Curl-

Route 2 -

Curl

Route 3 -

Curl

Route 4 -

Curl

Complete file-

That’s it for this time! I hope you enjoyed this post. As always, I welcome questions, notes, comments and requests for posts on topics you’d like to read. See you next time! Happy Coding !!!!!

--

--

I’m a MERN Developer. ( Redux | AWS | Python ) I enjoy taking on new things, building skills, and sharing what I’ve learned.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ankit Kumar Rajpoot

I’m a MERN Developer. ( Redux | AWS | Python ) I enjoy taking on new things, building skills, and sharing what I’ve learned.