Pārlūkot izejas kodu

remove default server

tags/v0.9.0
jimzhan pirms 9 gadiem
vecāks
revīzija
dcd74d4518
1 mainītis faili ar 9 papildinājumiem un 5 dzēšanām
  1. +9
    -5
      README.md

+ 9
- 5
README.md Parādīt failu

@@ -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()
}
```


Notiek ielāde…
Atcelt
Saglabāt