add cmd to gen routes.go, main.go
This commit is contained in:
@ -16,9 +16,17 @@ script:
|
|||||||
|
|
||||||
- go test github.com/leanote/leanote/app/tests
|
- go test github.com/leanote/leanote/app/tests
|
||||||
|
|
||||||
|
# gen tmp/main.go, routes/routes.go
|
||||||
|
- go run app/cmd/main.go
|
||||||
|
# build
|
||||||
- go build -o leanote github.com/leanote/leanote/app/tmp
|
- go build -o leanote github.com/leanote/leanote/app/tmp
|
||||||
|
# run with port 9000
|
||||||
- ./leanote -importPath=github.com/leanote/leanote -runMode=dev -port=9000 &
|
- ./leanote -importPath=github.com/leanote/leanote -runMode=dev -port=9000 &
|
||||||
|
# test
|
||||||
- wget http://localhost:9000
|
- wget http://localhost:9000
|
||||||
|
- wget http://localhost:9000/blog
|
||||||
|
- wget http://localhost:9000/login
|
||||||
|
- wget http://localhost:9000/demo
|
||||||
|
|
||||||
# - revel build github.com/leanote/leanote tmp
|
# - revel build github.com/leanote/leanote tmp
|
||||||
# OK
|
# OK
|
19
app/cmd/main.go
Normal file
19
app/cmd/main.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/revel/revel"
|
||||||
|
"github.com/revel/cmd/harness"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// go run main.go
|
||||||
|
// 生成routes.go, main.go
|
||||||
|
revel.Init("", "github.com/leanote/leanote", "")
|
||||||
|
_, err := harness.Build() // ok, err
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
fmt.Println("Ok")
|
||||||
|
// panicOnError(reverr, "Failed to build")
|
||||||
|
}
|
Reference in New Issue
Block a user