Skip to content

Commit

Permalink
Use web prefix for main API
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzhuojie committed Mar 9, 2019
1 parent 65fd5b9 commit 5fdbb92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion browser/flagr-ui/config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
NODE_ENV: '"production"',
API_URL: '"/api/v1"',
API_URL: '"api/v1"',

// ',' separated string
// For example
Expand Down
4 changes: 4 additions & 0 deletions pkg/config/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func SetupGlobalMiddleware(handler http.Handler) http.Handler {

n.Use(setupRecoveryMiddleware())

if Config.WebPrefix != "" {
handler = http.StripPrefix(Config.WebPrefix, handler)
}

if Config.PProfEnabled {
n.UseHandler(pprof.New()(handler))
} else {
Expand Down

0 comments on commit 5fdbb92

Please sign in to comment.