aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.go b/main.go
index dfeec0c..6b9704c 100644
--- a/main.go
+++ b/main.go
@@ -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"))