|
|
|
|
|
|
|
|
package main |
|
|
package main |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"io" |
|
|
|
|
|
|
|
|
"github.com/goanywhere/rex" |
|
|
"github.com/goanywhere/rex" |
|
|
"github.com/goanywhere/x/env" |
|
|
"github.com/goanywhere/x/env" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func index (ctx *rex.Context) { |
|
|
|
|
|
ctx.Render("index.html") |
|
|
|
|
|
|
|
|
func index(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
io.WriteString("Hey you") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func main() { |
|
|
func main() { |
|
|
// Override default 5000 port here. |
|
|
// Override default 5000 port here. |
|
|
env.Set("PORT", 9394) |
|
|
env.Set("PORT", 9394) |
|
|
|
|
|
|
|
|
rex.Get("/", index) |
|
|
rex.Get("/", index) |
|
|
rex.Run() |
|
|
rex.Run() |
|
|
} |
|
|
} |