diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-09-03 15:00:03 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-09-03 15:00:03 +0530 |
commit | 95dfc551f7eaaf6e8ebdefce1b733951354ac40d (patch) | |
tree | ecabef39a94084c456eaf32bb508d8809d592c9f /main.go | |
parent | fc83df70b787e447bf31f4d99fa723c7e38544f2 (diff) |
added JWT authorization middleware
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -51,8 +51,13 @@ func main() { { user.Routes(api) auth.Routes(api) - customer.Routes(api) - item.Routes(api) + } + + protected := api.Group("/") + protected.Use(auth.Authorize()) + { + customer.Routes(protected) + item.Routes(protected) } r.Run(":" + viper.GetString("port")) |