How to Structure a Golang REST API
ฝัง
- เผยแพร่เมื่อ 22 ก.ค. 2024
- This extensive course will teach you the fundamental methods and best practices for organising a Golang REST API to guarantee scalability and maintainability. We will walk you through the steps of creating a neat and effective project architecture, putting reusable and modular code into practice, and making the most of the Gin framework.
This course will provide you the skills and knowledge you need to build reliable and scalable RESTful APIs in Go, regardless of your level of expertise as a developer. You can use it to construct your first API or enhance your knowledge. Come learn from the pros at organising Golang REST APIs and advance your programming abilities!
Content Timestamp
0:00 Setting up your Rest API server with Gin
1:43 Project structure to for maintainability
3:09 How to Use Gin in creating a server
24:43 Adding env to your Golang project structure
38:23 How to Use GORM, an ORM library for Golang
1:00:48 Setting up auto-migration with GORM.
1:07:49 Creating a user repository to utilise GORM Queries
1:32:10 Creating a handler for POST and GET endpoints
1:47:29 Registering routes with Gin Server
2:04:35 Testing endpoints with POSTMAN
Project Source Code: github.com/withsilasogar/rest...
Great job
Very interesting
Very educational
What an incredibly informative video! Good Job 👍
Thank you
Very informative 🙏 Thank you
This video just uplifted my status as a golang developer. Thanks Silas Ogar
Glad it was helpful!
Great job👍
Nice
I have been looking for an indept tutorial like this. Thank you very much.
Can I make a request ?
Glad to know it was of help, feel free to make your request
@@TechEducationWithSilasOgar Can you please create a tutorial on how to use GRPC in GoLang
@@techwithdenis Sure, will look into it
@@TechEducationWithSilasOgarsorry sir please can I chat with you on WhatsApp
Good one but too much using frameworks and libraries should be avoided.
If anyone encounter the "404 page not found" error after completing the video, try checking your server.go file and under the function you created for group routes replace all the case excecution from gs.engine.GET(path, handler) to group.GET(route.Path, route.Handler). I think the video did not cover the part where he debugged that issue
Thanks for the keen observation, it was captured right after the second to the last timeline. (1:54:47)
@@TechEducationWithSilasOgar ooh that's true, I was the one that wasn't observant there. My bad network made me watch it on 480p