mirror of
https://github.com/labstack/echo.git
synced 2025-04-21 12:17:04 +02:00
Changed default port in examples
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
c58ec742a9
commit
1b757d99d8
@ -99,7 +99,7 @@ func main() {
|
|||||||
e.Get("/", hello)
|
e.Get("/", hello)
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Run(":4444")
|
e.Run(":1323)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -70,5 +70,5 @@ func main() {
|
|||||||
e.Delete("/users/:id", deleteUser)
|
e.Delete("/users/:id", deleteUser)
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Run(":4444")
|
e.Run(":1323")
|
||||||
}
|
}
|
||||||
|
@ -23,5 +23,5 @@ func main() {
|
|||||||
e.Get("/", hello)
|
e.Get("/", hello)
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Run(":4444")
|
e.Run(":1323")
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ func main() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Run(":4444")
|
e.Run(":1323")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -298,11 +298,11 @@ func (r *router) Find(method, path string, ctx *Context) (h HandlerFunc, echo *E
|
|||||||
cn = c
|
cn = c
|
||||||
ctx.pvalues[n] = search
|
ctx.pvalues[n] = search
|
||||||
search = "" // End search
|
search = "" // End search
|
||||||
} else {
|
continue
|
||||||
|
}
|
||||||
// Not found
|
// Not found
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
func (r *router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -252,7 +252,7 @@ func main() {
|
|||||||
return &echo.HTTPError{Code: http.StatusUnauthorized}
|
return &echo.HTTPError{Code: http.StatusUnauthorized}
|
||||||
})
|
})
|
||||||
e.Get("/welcome", welcome)
|
e.Get("/welcome", welcome)
|
||||||
e.Run(":4444")
|
e.Run(":1323")
|
||||||
}
|
}
|
||||||
|
|
||||||
func welcome(c *echo.Context) *echo.HTTPError {
|
func welcome(c *echo.Context) *echo.HTTPError {
|
||||||
|
@ -74,7 +74,7 @@ func main() {
|
|||||||
e.Get("/", hello)
|
e.Get("/", hello)
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Run(":4444")
|
e.Run(":1323")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ whenever server receives an HTTP request at `/`, hello handler is called.
|
|||||||
In hello handler `c.String(http.StatusOK, "Hello, World!\n")` sends a text/plain
|
In hello handler `c.String(http.StatusOK, "Hello, World!\n")` sends a text/plain
|
||||||
HTTP response to the client with 200 status code.
|
HTTP response to the client with 200 status code.
|
||||||
|
|
||||||
`e.Run(":4444")` Starts HTTP server at network address `:4444`.
|
`e.Run(":1323")` Starts HTTP server at network address `:1323`.
|
||||||
|
|
||||||
Now start the server using command
|
Now start the server using command
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ Now start the server using command
|
|||||||
$ go run server.go
|
$ go run server.go
|
||||||
```
|
```
|
||||||
|
|
||||||
Browse to [http://localhost:4444](http://localhost:4444) and you should see
|
Browse to [http://localhost:1323](http://localhost:1323) and you should see
|
||||||
Hello, World! on the page.
|
Hello, World! on the page.
|
||||||
|
|
||||||
### Next?
|
### Next?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user