WWWShop/wwwshop/wwwshop.go

25 lines
409 B
Go

package wwwshop
import (
"net/http"
"fmt"
d "WWWShop/wwwshop/dao/database"
)
type WWWShop struct {}
func New() WWWShop {
var self = WWWShop {};
return self;
}
func (self WWWShop) Init() {
var db = d.DB()
d.Migrate(db)
http.HandleFunc("/", func( w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello world")
})
http.ListenAndServe(":8080", nil)
}