1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-19 09:10:55 +00:00
Beego/beego/beego.go

58 lines
759 B
Go
Raw Normal View History

2012-03-05 13:54:50 +00:00
package beego
2012-03-30 15:48:36 +00:00
import {
"net"
"net/http"
"net/http/fcgi"
"log"
"strconv"
"./core"
}
2012-03-26 15:18:16 +00:00
type C struct {
core.Content
}
type M struct{
core.Model
}
type D struct{
core.Config
}
type U struct{
core.URL
}
type A struct{
core.Controller
}
type V struct{
core.View
2012-03-30 15:48:36 +00:00
}
type BeegoApp struct{
Port int
}
func (app *BeegoApp) BeeListen(port int) {
app.Port = port
err := http.ListenAndServe(":"+strconv.Itoa(app.Port), nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
func (app *BeegoApp) BeeListenFcgi(port int) {
app.Port = port
l, err := net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(port))
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
fcgi.Serve(l, app.Handler)
}
func Run() {
rootPath, _ := os.Getwd()
2012-03-05 13:54:50 +00:00
}