Learn how to create a simple RESTful API using mock data and the Go programming language in this tutorial.
Learn how to use the mux URL router to create various CRUD endpoints for manipulating mock data that has been hardcoded into the application.
A written version of this video can be seen on my blog at https://www.thepolyglotdeveloper.com/2016/07/create-a-simple-restful-api-with-golang/
Amazon Auto Links: No products found.
I read your home directory as ‘NRA boy’
This was brilliant ! thank you ever so much for taking the time to share this with us !
Very good tutorial ! thanks. I’m a newbie for golang and looking for restful api.
which editor you are using?
Hey Nic, great example, do you think you could make a video with a database and a front end?
Which IDE do you use?
Great tutorial! It helped allot to keep it clean and simple!.
Thanks explaining how the simple structure of api’s work in Golang.
what atom plugin you use so it can automatically import required library?
Hey there-great video! Unfortunately, when I get to the postman stage and try to ping the API through localhost just like you, it always returns null for the response! Could there be something weird with port forwarding or firewalls blocking certain things from working, or could the fact that I’m on public wifi be messing something up? Thanks!
can you share a list of the plugins you’re using with atom?
Hi Nic, I know that this is a quick demo, but you should be returning the right HTTP status codes: 201 for new records, 404 when getting/deleting an unknown ID, 400 if the ID already exists and you try to create a new one.
Thanks for the tutorial!
Great job !!! this is first video with real rest api in golang
Really helpful thanks!
Do you have part 2 available yet?
Outstanding. Thanks for the video!
Excellent, budy!
CreatePerson should not have {id}, UpdatePerson should have it, since in real world scenario new id will be created by backend, since front end won’t know which is the new id that has to be created.
Which plugins are you using???
Great job with this tutorial
Great work ! Thank you for sharing
I’ve literally been looking at Go for the last few hours, and damn, it looks so powerful , but clean and sexy.
Well i think that go syntax is not so easy like Python or Ruby, but i think is the language of the feature … freakin fast!!
Hi Sir,
M getting below error on postman
404 page not found
what to do
Why didn’t you have to type “return” for GetPeopleEndPoint? line 30
I like the theme you are using. May I know the name of it?
One thing worth remembering is that this API implementation is not safe to call concurrently, as there are methods modifying a global data structure. I don’t think this implication was mentioned in the video. @Nic Raboy great work man!
For a newbie like me, this is gold. Thank you very much!
The JSON encoder you are using is not setting the Content-Type header as application/json. That is why the response appears non-formatted in Postman. The tutorial was awesome and I already built it. Thanks for the great explanation.
how to build a pagination system ?