瀏覽代碼

remove default server

tags/v0.9.0
jimzhan 9 年之前
父節點
當前提交
dcd74d4518
共有 1 個檔案被更改,包括 9 行新增5 行删除
  1. +9
    -5
      README.md

+ 9
- 5
README.md 查看文件

@@ -41,10 +41,11 @@ import (
)

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")
})
rex.Run()
app.Run()
}
```

@@ -68,6 +69,7 @@ package main
import (
"io"

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

@@ -77,9 +79,11 @@ func index(w http.ResponseWriter, r *http.Request) {

func main() {
// 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…
取消
儲存