![]() ![]() In future articles, we will explore more of the Gin Framework. go get -u /gin-gonic/ginįor this article, we will be using the Gin Routers and Middleware Implementation. Run the following to install gin on your machine and use it for golang projects. Gin is a framework that reduces boilerplate code that would normally go into building these applications. I liked their tooling and how much better the development experience gets. They are kinda popular too, with over 55,000 stars on Github. They advertise themselves to be 40 times faster than the normal HTTP routers. I came across Gin, which is a web development framework for Golang APIs. We don’t want to store the actual password directly into the database, yeah? Gin – Quick Introduction Here, we will be using a bunch of helpers to encrypt/hash the user passwords. Also, as mentioned earlier, in the registration process, we will be storing the user data in a MySQL database using the GORM Abstraction. This will be used by our custom Middleware to restrict access. We will also add some helpers for JWT that will assist us in Generating the tokens with proper expiration times and claims, and a way to Validate the sent tokens. This is just to showcase the ability of the middleware that we will build to restrict access to only the requests that have an actual valid JWT in the request header.
0 Comments
Leave a Reply. |