Browse Source

remove default server

tags/v0.9.0
jimzhan 9 years ago
parent
commit
dcd74d4518
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      README.md

+ 9
- 5
README.md View File

) )


func main() { func main() {
rex.Get("/", func(w http.ResponseWriter, r *http.Request) {
app := rex.New()
app.Get("/", func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello World") io.WriteString(w, "Hello World")
}) })
rex.Run()
app.Run()
} }
``` ```


import ( import (
"io" "io"


"github.com/goanywhere/env"
"github.com/goanywhere/rex" "github.com/goanywhere/rex"
) )




func main() { func main() {
// Override default 5000 port here. // Override default 5000 port here.
rex.Env.Set("PORT", 9394)
rex.Get("/", index)
rex.Run()
env.Set("PORT", 9394)

app := rex.New()
app.Get("/", index)
app.Run()
} }
``` ```



Loading…
Cancel
Save