File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,20 @@ import (
55 "net/http"
66 "path/filepath"
77 "strings"
8+
9+ "github.com/fatih/color"
810)
911
1012type Server struct {
11- router * Router
12- notFound HandlerFunc
13+ router * Router
14+ notFound HandlerFunc
1315}
1416
17+ // A new Flint Server is created.
1518func NewServer () * Server {
1619 s := & Server {
1720 router : NewRouter (),
1821 }
19- // Varsayılan 404
2022 s .notFound = func (ctx * Context ) {
2123 ctx .Default404 ()
2224 }
@@ -50,7 +52,9 @@ func (s *Server) Run(addr ...string) error {
5052 port = addr [0 ]
5153 }
5254
53- fmt .Println ("Flint-Server starting..." )
55+ boldWhite := color .New (color .FgWhite , color .Bold )
56+ boldWhite .Println ("Flint Server is Starting..." )
57+ fmt .Println ("---------------------------" )
5458
5559 displayAddr := port
5660 if strings .HasPrefix (port , ":" ) {
@@ -61,7 +65,8 @@ func (s *Server) Run(addr ...string) error {
6165 displayAddr = "http://" + port
6266 }
6367
64- fmt .Println ("Listening on" , displayAddr )
68+ color .Red ("Listening on %s" , displayAddr )
69+ color .Cyan ("Port: %s" , strings .TrimPrefix (port , ":" ))
6570
6671 err := http .ListenAndServe (port , s .router )
6772 if err != nil {
You can’t perform that action at this time.
0 commit comments