In this video we will look at building a simple REST API using the Go programming language along with the Mux router. I will also explain some of the fundamentals of the language for beginners.
SPONSOR: GDP HOST – WANT CHEAP WEB HOSTING?
https://goo.gl/iZjcGk
CODE: Github Repo
https://github.com/bradtraversy/go_restapi
BECOME A PATRON: Show support & get perks!
http://www.patreon.com/traversymedia
ONE TIME DONATIONS:
http://www.paypal.me/traversymedia
VISIT MY WEBISTE: Check Out My Udemy Courses
http://www.traversymedia.com
FOLLOW TRAVERSY MEDIA:
http://www.facebook.com/traversymedia
http://www.twitter.com/traversymedia
http://www.instagram.com/traversymedia
https://discord.gg/traversymedia
Amazon Auto Links: No products found.
RUST RUST RUST!
This was excellent Brad. The syntax for Goland is very appealing and I look forward to more tutorials.
I know this question is off the topic, but I really wanna know if I should learn jQuery anymore. If it’s about DOM, I have no problem with vanilla javascript and animations can be easily done with CSS animations. Is there anything else that I need jQuery for? I’d love to hear the answer, specifically from Brad.
Have u tried cmder its really cool command line tool for windows
I have been waiting for this, Thanks traversy. Can’t wait for the course.Go is my favorite language,just started learning it
Finally! Thanks so much for doing this, pls do a course on this!
please upload new tutorials for golang
Hey Brad, great job on all of these tutorials!
[preface: I am pretty new to web dev]
Quick question on something not related to this video – I’ve built a web app (Materialize framework) structured like the one in your NodeJS + MongoDB Article Database series from a while back and I was wondering – what would be the best way to convert it to mobile? (I just want to be able to use it on my phone, doesn’t have to be big on app store, etc)
There are a few options that I’ve thought of/just read about:
1) Getting a domain for the web app and just manually search it up in browser on phone
2) Using Apache Cordova to convert web to mobile app (I don’t know how legit this would be)
3) Redesigning the whole app using Ionic and Angular in one of your previous tutorials
4) Redesigning the whole app using React Native instead (I don’t know how difficult or practical this would be)
5) Redesigning whole app using Meteorjs (is this even legit?)
Again, I haven’t explored these options in depth yet and I don’t know the frameworks very well but I would appreciate any suggestions that you have.
Are the parenthesis supposed to be purple? Mine aren’t and it’s the only I can’t think of a good reason why mine isn’t working
Create course!…..Thank you. Awesome!
Hi Brad! I’ve already bought a few of your courses on Udemy and I learned a ton from them. But I’m wondering if you could make a course making a social media app, like a facebook clone, using angular and firestore.
I was shocked to see this video. THANKS! You are awesome. So is golang
Excellent video Brad! Thank you very much!
hello, why my go run run very slow on my windows pc, yours is much faster to compile, i’m using i7 pc
Great tutorial, we’re waiting for the second part
Thanks again Brad!!! God Bless you!!!
this is the best go tutorial for bignner ever I seen….
I think a lot of us would by a course about go from you. Hit the like if you’re would too.
When will the course come up? Golang lacks courses in Youtube, Udemy and so on. It will be big I am sure.
Why did you decide to capitalize the structs in this project? I mean they worked just fine for me in lowercase and (afaik) having them start with an uppercase letter would only export them (which wouldn’t be needed in this small project).
The ugliest language ever.
But your channel is great!
Thanks again Brad. Another really good tutorial. Go is by far my favourite language just now and for the purpose of serving json apis in this manner is highly performant. You’ve shown how to get this done efficiently and explain how to get there in a very clear and easy to understand way.
Nice course mate, you should create a Ruby on Rails course on Udemy, will buy for sure!!
Loved it! And waiting for the 2nd part with database <3
what golang framework you suggest to learn, like what is the most popular ?
For the update function didn’t need to do anything with the ID as the book object included the right ID .
func updateBook(w http.ResponseWriter, r *http.Request) {
w.Header().Set(“Content-Type”, “application/json”)
params := mux.Vars(r)
var book Book
_ = json.NewDecoder(r.Body).Decode(&book)
for index, item := range books {
if item.ID == params[“id”] {
books = append(books[:index], books[index+1:]…)
books = append(books, book)
break
}
}
json.NewEncoder(w).Encode(book)
}
Great! Love your style~
Hello Traversy, do you have a golang + vuejs/reactjs course on udemy ?