🐛 Optimized launchpad
This commit is contained in:
@@ -65,7 +65,7 @@ func main() {
|
||||
|
||||
app := fiber.New(fiber.Config{
|
||||
ServerHeader: "Turbine Gateway",
|
||||
BodyLimit: 2147483647, // 2GB
|
||||
BodyLimit: 2147483647,
|
||||
})
|
||||
|
||||
// Health check and status
|
||||
@@ -95,8 +95,8 @@ func main() {
|
||||
app.Use(from, func(c fiber.Ctx) error {
|
||||
instance, err := serviceDiscovery.GetNextInstance(serviceName)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("service", serviceName).Msg("Failed to get service instance for override")
|
||||
return c.Status(fiber.StatusServiceUnavailable).SendString(err.Error())
|
||||
log.Info().Err(err).Str("service", serviceName).Msg("No service found")
|
||||
return fiber.ErrNotFound
|
||||
}
|
||||
|
||||
targetURL := fmt.Sprintf("http://%s/%s", instance, remainingPath)
|
||||
@@ -138,7 +138,7 @@ func main() {
|
||||
return c.Status(fiber.StatusServiceUnavailable).SendString(err.Error())
|
||||
}
|
||||
|
||||
targetURL := fmt.Sprintf("http://%s/%s", instance, remainingPath)
|
||||
targetURL := fmt.Sprintf("http://%s/api/%s", instance, remainingPath)
|
||||
if len(c.Request().URI().QueryString()) > 0 {
|
||||
targetURL = fmt.Sprintf("%s?%s", targetURL, string(c.Request().URI().QueryString()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user