Skip to content

Commit

Permalink
code restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
sash20m committed Nov 17, 2023
1 parent 881d9e4 commit e1f73ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (app *AppServer) Run(appConfig config.ApiEnvConfig) {
router := mux.NewRouter().StrictSlash(true)
router.MethodNotAllowedHandler = http.HandlerFunc(app.NotAllowedHandler)
router.NotFoundHandler = http.HandlerFunc(app.NotFoundHandler)

router.Methods("GET").Path("/api/books").HandlerFunc(app.GetBooksHandler)
router.Methods("GET").Path("/api/book/{id:[0-9]+}").HandlerFunc(app.GetBookHandler)
router.Methods("POST").Path("/api/book/add").HandlerFunc(app.AddBookHandler)
Expand Down
8 changes: 4 additions & 4 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import (
// not be in this root directory. Any other configuration to OutputLog can be made here.
var OutputLog = logrus.New()

// Log is used to output the logs to the console in the development mode.
// Any other configuration to Log can be made here.
var Log = logrus.New()

func init() {
// The logs directory path has been set to this root directory, but do not keep them here. Add your own path to a
// directory outside of the root project, like /var/log/myapp for Unix/Linux systems, where you can separate the concerns
Expand All @@ -24,3 +20,7 @@ func init() {
}
OutputLog.Out = file
}

// Log is used to output the logs to the console in the development mode.
// Any other configuration to Log can be made here.
var Log = logrus.New()

0 comments on commit e1f73ef

Please sign in to comment.