refactor(config): Load gotenberg url from env
This commit is contained in:
@@ -60,7 +60,7 @@ func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
c.Set(fiber.HeaderContentType, "text/html")
|
||||
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
||||
converter := services.GotenbergConverter{BaseUrl: h.Config.GotenbergBaseUrl}
|
||||
pdf, err := converter.ToPdf(result, "a4", false)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||
|
||||
@@ -60,7 +60,7 @@ func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
c.Set(fiber.HeaderContentType, "text/html")
|
||||
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
||||
converter := services.GotenbergConverter{BaseUrl: h.Config.GotenbergBaseUrl}
|
||||
pdf, err := converter.ToPdf(result, "a4", false)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||
|
||||
@@ -64,7 +64,7 @@ func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
|
||||
converter := services.GotenbergConverter{BaseUrl: h.Config.GotenbergBaseUrl}
|
||||
pdf, err := converter.ToPdf(result, "a5", true)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||
|
||||
Reference in New Issue
Block a user