mirror of
https://github.com/donl/gPanel.git
synced 2026-05-29 14:22:24 -06:00
commit
647bd0bc91
2 changed files with 15 additions and 17 deletions
|
|
@ -10,21 +10,20 @@ import (
|
|||
"github.com/Ennovar/gPanel/general/routing"
|
||||
)
|
||||
|
||||
type privateHost struct {
|
||||
type PrivateHost struct {
|
||||
Auth int
|
||||
Directory string
|
||||
}
|
||||
|
||||
func NewPrivateHost() privateHost {
|
||||
priv := privateHost{}
|
||||
|
||||
priv.Auth = 1 // Handle Auth
|
||||
priv.Directory = "private/"
|
||||
|
||||
return priv
|
||||
// NewPrivateHost returns a new PrivateHost type.
|
||||
func NewPrivateHost() PrivateHost {
|
||||
return PrivateHost{
|
||||
Auth: 1,
|
||||
Directory: "private/",
|
||||
}
|
||||
}
|
||||
|
||||
func (priv *privateHost) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func (priv *PrivateHost) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
path := req.URL.Path[1:]
|
||||
path = (priv.Directory + path)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,19 +10,18 @@ import (
|
|||
"github.com/Ennovar/gPanel/general/routing"
|
||||
)
|
||||
|
||||
type publicWeb struct {
|
||||
type PublicWeb struct {
|
||||
Directory string
|
||||
}
|
||||
|
||||
func NewPublicWeb() publicWeb {
|
||||
pub := publicWeb{}
|
||||
|
||||
pub.Directory = "public/"
|
||||
|
||||
return pub
|
||||
// NewPublicWeb returns a new PublicWeb type.
|
||||
func NewPublicWeb() PublicWeb {
|
||||
return PublicWeb{
|
||||
Directory: "public/",
|
||||
}
|
||||
}
|
||||
|
||||
func (pub *publicWeb) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func (pub *PublicWeb) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
path := req.URL.Path[1:]
|
||||
path = (pub.Directory + path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue