mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Removed banner
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
04a7fc65e3
commit
093edb39ab
36
echo.go
36
echo.go
@ -63,7 +63,6 @@ type (
|
||||
TLSServer *http.Server
|
||||
Listener net.Listener
|
||||
TLSListener net.Listener
|
||||
HideBanner bool
|
||||
DisableHTTP2 bool
|
||||
Debug bool
|
||||
HTTPErrorHandler HTTPErrorHandler
|
||||
@ -123,30 +122,6 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
// Banner
|
||||
const (
|
||||
// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
|
||||
banner = `
|
||||
____ __
|
||||
/ __/___/ / ___
|
||||
/ _// __/ _ \/ _ \
|
||||
/___/\__/_//_/\___/
|
||||
|
||||
%s %s
|
||||
|
||||
High performance, minimalist Go web framework
|
||||
______________________________________O/_____
|
||||
O\
|
||||
|
||||
⇛ %s server started on %s
|
||||
`
|
||||
)
|
||||
|
||||
const (
|
||||
website = "https://echo.labstack.com"
|
||||
version = "3.1.0.master"
|
||||
)
|
||||
|
||||
// HTTP methods
|
||||
const (
|
||||
CONNECT = "CONNECT"
|
||||
@ -592,15 +567,6 @@ func (e *Echo) StartServer(s *http.Server) error {
|
||||
e.colorer.SetOutput(e.Logger.Output())
|
||||
s.Handler = e
|
||||
s.ErrorLog = e.stdLogger
|
||||
args := []interface{}{e.colorer.Blue(website), e.colorer.Red("v" + version), "http", e.colorer.Green(s.Addr)}
|
||||
if s.TLSConfig != nil {
|
||||
args[2] = "https"
|
||||
}
|
||||
|
||||
// Banner
|
||||
if !e.HideBanner {
|
||||
e.colorer.Printf(banner, args...)
|
||||
}
|
||||
|
||||
l, err := net.Listen("tcp", s.Addr)
|
||||
if err != nil {
|
||||
@ -610,11 +576,13 @@ func (e *Echo) StartServer(s *http.Server) error {
|
||||
if e.Listener == nil {
|
||||
e.Listener = tcpKeepAliveListener{l.(*net.TCPListener)}
|
||||
}
|
||||
e.colorer.Printf("⇛ https server started on %s\n", e.colorer.Green(s.Addr))
|
||||
return s.Serve(e.Listener)
|
||||
}
|
||||
if e.TLSListener == nil {
|
||||
e.TLSListener = tls.NewListener(tcpKeepAliveListener{l.(*net.TCPListener)}, s.TLSConfig)
|
||||
}
|
||||
e.colorer.Printf("⇛ https server started on %s\n", e.colorer.Green(s.Addr))
|
||||
return s.Serve(e.TLSListener)
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ curl \
|
||||
|
||||
`201 - Created`
|
||||
|
||||
```sh
|
||||
```js
|
||||
{
|
||||
"id": "584661b9a6fe8871a3804cba",
|
||||
"to": "58465b4ea6fe886d3215c6df",
|
||||
@ -183,7 +183,7 @@ curl \
|
||||
|
||||
`200 - OK`
|
||||
|
||||
```sh
|
||||
```js
|
||||
[
|
||||
{
|
||||
"id": "584661b9a6fe8871a3804cba",
|
||||
|
@ -37,10 +37,6 @@ Default value is `OFF`. Possible values:
|
||||
Logging is implemented using `echo.Logger` interface which allows you to register
|
||||
a custom logger using `Echo#Logger`.
|
||||
|
||||
### Hide Banner
|
||||
|
||||
`Echo#HideBanner` can be used to hide the startup banner.
|
||||
|
||||
## Custom Server
|
||||
|
||||
### Using `Echo#StartServer()`
|
||||
|
Loading…
Reference in New Issue
Block a user