26 lines
401 B
Go
26 lines
401 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
"path"
|
|
"os"
|
|
)
|
|
|
|
var _ = http.Handler(&Handler{})
|
|
|
|
// The type describes behaviour
|
|
// of handling stuff like in PHP.
|
|
type Handler struct {
|
|
// THe field represents
|
|
// where we store site's
|
|
// source files and request handlers.
|
|
SourcePath string
|
|
}
|
|
|
|
func (h *Handler) ServeHTTP(
|
|
w http.ResponseWriter,
|
|
r *http.Request,
|
|
) {
|
|
p := r.URL.Path
|
|
p = path.Clean(p)
|
|
}
|