Compare commits
No commits in common. "63d5d0dc5950638797f2fa8130b3b3d8d04097ca" and "d97a2f3bca07383dd4f85e3a031cbe849ef95d6d" have entirely different histories.
63d5d0dc59
...
d97a2f3bca
@ -1,18 +0,0 @@
|
||||
package framework
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Core is the core struct of the framework
|
||||
type Core struct{}
|
||||
|
||||
// NewCore initialize the Core.
|
||||
func NewCore() *Core {
|
||||
return &Core{}
|
||||
}
|
||||
|
||||
// ServeHTTP implements the Handler interface
|
||||
func (c *Core) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO
|
||||
}
|
27
main.go
27
main.go
@ -1,27 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"git.vinchent.xyz/vinchent/go-web/framework"
|
||||
)
|
||||
|
||||
type FooHandler struct{}
|
||||
|
||||
func (foo FooHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
|
||||
}
|
||||
|
||||
func main() {
|
||||
server := &http.Server{
|
||||
Addr: ":8080",
|
||||
Handler: framework.NewCore(),
|
||||
}
|
||||
|
||||
if err := server.ListenAndServe(); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user