mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: add greeting banner
This commit is contained in:
@ -9,6 +9,17 @@ import (
|
|||||||
"memos/store"
|
"memos/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
greetingBanner = `
|
||||||
|
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
|
||||||
|
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
|
||||||
|
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
|
||||||
|
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
|
||||||
|
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
|
||||||
|
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||||
|
`
|
||||||
|
)
|
||||||
|
|
||||||
type Main struct {
|
type Main struct {
|
||||||
profile *common.Profile
|
profile *common.Profile
|
||||||
}
|
}
|
||||||
@ -37,9 +48,11 @@ func Execute() {
|
|||||||
profile: profile,
|
profile: profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := m.Run()
|
println(greetingBanner)
|
||||||
if err != nil {
|
fmt.Printf("Version %s has started at :%d\n", profile.Version, profile.Port)
|
||||||
fmt.Printf("%+v\n", err)
|
|
||||||
|
if err := m.Run(); err != nil {
|
||||||
|
fmt.Printf("error: %+v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ func NewServer(profile *common.Profile) *Server {
|
|||||||
e := echo.New()
|
e := echo.New()
|
||||||
e.Debug = true
|
e.Debug = true
|
||||||
e.HideBanner = true
|
e.HideBanner = true
|
||||||
e.HidePort = false
|
e.HidePort = true
|
||||||
|
|
||||||
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
|
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
|
||||||
Format: "${method} ${uri} ${status}\n",
|
Format: "${method} ${uri} ${status}\n",
|
||||||
|
Reference in New Issue
Block a user