mirror of
https://github.com/foomo/neosproxy.git
synced 2025-10-16 12:35:39 +00:00
strip base path
This commit is contained in:
parent
313dcdb339
commit
f1df8688b0
@ -5,12 +5,12 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/foomo/neosproxy/cache/content/store/fs"
|
||||
"github.com/foomo/neosproxy/client/cms"
|
||||
"github.com/foomo/neosproxy/config"
|
||||
"github.com/foomo/neosproxy/logging"
|
||||
"github.com/foomo/neosproxy/proxy"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
10
config/vo.go
10
config/vo.go
@ -17,8 +17,9 @@ type ObserverInterface interface {
|
||||
// Config struct definition
|
||||
type Config struct {
|
||||
Proxy struct {
|
||||
Address string
|
||||
Token string
|
||||
Address string
|
||||
Token string
|
||||
BasePath string
|
||||
}
|
||||
Neos Neos
|
||||
Cache Cache
|
||||
@ -77,8 +78,9 @@ type ObserverWebhook struct {
|
||||
|
||||
type configFile struct {
|
||||
Proxy struct {
|
||||
Address string
|
||||
Token string
|
||||
Address string
|
||||
Token string
|
||||
BasePath string
|
||||
}
|
||||
Neos struct {
|
||||
URL string `json:"url" yaml:"url"`
|
||||
|
||||
@ -4,7 +4,7 @@ import (
|
||||
"crypto/subtle"
|
||||
"net/http"
|
||||
|
||||
"github.com/auth0/go-jwt-middleware"
|
||||
jwtmiddleware "github.com/auth0/go-jwt-middleware"
|
||||
"github.com/foomo/neosproxy/logging"
|
||||
)
|
||||
|
||||
@ -14,7 +14,8 @@ import (
|
||||
|
||||
// Run a proxy
|
||||
func (p *Proxy) Run() error {
|
||||
return http.ListenAndServe(p.config.Proxy.Address, p.router)
|
||||
handler := http.StripPrefix(p.config.Proxy.BasePath, p.router)
|
||||
return http.ListenAndServe(p.config.Proxy.Address, handler)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user