Add and register invoice endpoint

This commit is contained in:
Stefan Kostic
2022-03-18 18:03:46 +01:00
parent 61c8d8a53c
commit 2d34317acb
2 changed files with 60 additions and 0 deletions

View File

@@ -128,6 +128,7 @@ func main() {
// Public endpoints for account creation and authentication
e.POST("/auth", controllers.NewAuthController(svc).Auth)
e.POST("/create", controllers.NewCreateUserController(svc).CreateUser, strictRateLimitMiddleware)
e.POST("/invoice/:user_login", controllers.NewInvoiceController(svc).Invoice, middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(rate.Limit(c.DefaultRateLimit))))
// Secured endpoints which require a Authorization token (JWT)
secured := e.Group("", tokens.Middleware(c.JWTSecret), middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(rate.Limit(c.DefaultRateLimit))))