Skip to content

Commit

Permalink
#43 use macaron.v1
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Jan 19, 2018
1 parent bd04242 commit 9076dd8
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
siriscontext "github.com/go-siris/siris/context"
"github.com/nbari/violetear"
"github.com/urfave/negroni"
"gopkg.in/macaron.v1"
// "github.com/go-gas/gas" // NOTE(@kirilldanshin): gas is 404 now, comment out
bxog "github.com/claygod/Bxog"
"github.com/go-martini/martini"
Expand Down Expand Up @@ -160,8 +161,8 @@ func main() {
startLars()
case "lion":
startLion()
// case "macaron":
// startMacaron()
case "macaron":
startMacaron()
case "martini":
startMartini()
case "negroni":
Expand Down Expand Up @@ -651,19 +652,19 @@ func startLion() {
}

// Macaron
// func macaronHandler(c *macaron.Context) string {
// if sleepTime > 0 {
// time.Sleep(sleepTimeDuration)
// } else {
// runtime.Gosched()
// }
// return messageStr
// }
// func startMacaron() {
// mux := macaron.New()
// mux.Get("/hello", macaronHandler)
// http.ListenAndServe(":"+strconv.Itoa(port), mux)
// }
func macaronHandler(c *macaron.Context) string {
if sleepTime > 0 {
time.Sleep(sleepTimeDuration)
} else {
runtime.Gosched()
}
return messageStr
}
func startMacaron() {
mux := macaron.New()
mux.Get("/hello", macaronHandler)
http.ListenAndServe(":"+strconv.Itoa(port), mux)
}

// Martini
func martiniHandlerWrite(params martini.Params) string {
Expand Down

0 comments on commit 9076dd8

Please sign in to comment.