Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add terminal link to url #37

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/gookit/color v1.5.4
github.com/gookit/validate v1.5.1
github.com/goravel/framework v1.13.1-0.20231006012150-4a6e705dbd56
github.com/savioxavier/termlink v1.3.0
github.com/spf13/cast v1.5.1
github.com/stretchr/testify v1.8.4
github.com/valyala/fasthttp v1.50.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/savioxavier/termlink v1.3.0 h1:3Gl4FzQjUyiHzmoEDfmWEhgIwDiJY4poOQHP+k8ReA4=
github.com/savioxavier/termlink v1.3.0/go.mod h1:5T5ePUlWbxCHIwyF8/Ez1qufOoGM89RCg9NvG+3G3gc=
github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
Expand Down
5 changes: 3 additions & 2 deletions route.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/goravel/framework/support"
"github.com/goravel/framework/support/file"
"github.com/goravel/framework/support/json"
"github.com/savioxavier/termlink"
)

// Route fiber route
Expand Down Expand Up @@ -138,7 +139,7 @@ func (r *Route) Run(host ...string) error {
}

r.outputRoutes()
color.Greenln("[HTTP] Listening and serving HTTP on " + host[0])
color.Greenln("[HTTP] Listening and serving HTTP on" + termlink.Link("", "http://"+host[0]))

return r.instance.Listen(host[0])
}
Expand Down Expand Up @@ -183,7 +184,7 @@ func (r *Route) RunTLSWithCert(host, certFile, keyFile string) error {
}

r.outputRoutes()
color.Greenln("[HTTPS] Listening and serving HTTPS on " + host)
color.Greenln("[HTTPS] Listening and serving HTTPS on" + termlink.Link("", "https://"+host))

return r.instance.ListenTLS(host, certFile, keyFile)
}
Expand Down