You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-12-24 00:01:31 +02:00
Fixed web-app redirects
This commit is contained in:
@@ -44,7 +44,6 @@ func (c *Check) Health(ctx context.Context, w http.ResponseWriter, r *http.Reque
|
||||
|
||||
// Ping validates the service is ready to accept requests.
|
||||
func (c *Check) Ping(ctx context.Context, w http.ResponseWriter, r *http.Request, params map[string]string) error {
|
||||
|
||||
status := "pong"
|
||||
|
||||
return web.RespondText(ctx, w, status, http.StatusOK)
|
||||
|
||||
@@ -79,7 +79,7 @@ func main() {
|
||||
var cfg struct {
|
||||
Env string `default:"dev" envconfig:"ENV"`
|
||||
HTTP struct {
|
||||
Host string `default:"0.0.0.0:3000" envconfig:"HOST"`
|
||||
Host string `default:"0.0.0.0:3001" envconfig:"HOST"`
|
||||
ReadTimeout time.Duration `default:"10s" envconfig:"READ_TIMEOUT"`
|
||||
WriteTimeout time.Duration `default:"10s" envconfig:"WRITE_TIMEOUT"`
|
||||
}
|
||||
@@ -369,7 +369,7 @@ func main() {
|
||||
var serviceMiddlewares []web.Middleware
|
||||
|
||||
// Init redirect middleware to ensure all requests go to the primary domain contained in the base URL.
|
||||
if primaryServiceHost != "127.0.0.0" && primaryServiceHost != "localhost" {
|
||||
if primaryServiceHost != "127.0.0.1" && primaryServiceHost != "localhost" {
|
||||
redirect := mid.DomainNameRedirect(mid.DomainNameRedirectConfig{
|
||||
RedirectConfig: mid.RedirectConfig{
|
||||
Code: http.StatusMovedPermanently,
|
||||
|
||||
Reference in New Issue
Block a user