citedd commited on
Commit
fcf2217
·
verified ·
1 Parent(s): bc0b337

Update bin/app/main.go

Browse files
Files changed (1) hide show
  1. bin/app/main.go +6 -3
bin/app/main.go CHANGED
@@ -1,8 +1,10 @@
1
  package main
2
 
3
  import (
 
4
  "github.com/labstack/echo/v4"
5
  "github.com/labstack/echo/v4/middleware"
 
6
  chapterH "komikku-api/bin/modules/chapter/handlers"
7
  mangaH "komikku-api/bin/modules/manga/handlers"
8
  "komikku-api/bin/pkg/middlewares"
@@ -13,6 +15,7 @@ import (
13
  func main() {
14
  //Echo instance
15
  e := echo.New()
 
16
  e.Use(middleware.CORS())
17
  e.Use(middleware.Recover())
18
  e.Use(middlewares.Logger())
@@ -20,13 +23,13 @@ func main() {
20
  comicHttp := mangaH.New()
21
  comicHttp.Mount(e)
22
 
23
- chapterHttp := chapterH.New()
24
  chapterHttp.Mount(e)
25
 
26
  e.GET("/", func(c echo.Context) error {
27
- return utils.Response(map[string]string{"api-collection": "https://www.getpostman.com/collections/4c984c36d27bb591c445"}, "Get Collection", http.StatusOK, c)
28
  })
29
 
30
- listenerPort := ":7860"
31
  e.Logger.Fatal(e.Start(listenerPort))
32
  }
 
1
  package main
2
 
3
  import (
4
+ "fmt"
5
  "github.com/labstack/echo/v4"
6
  "github.com/labstack/echo/v4/middleware"
7
+ "komikku-api/bin/config"
8
  chapterH "komikku-api/bin/modules/chapter/handlers"
9
  mangaH "komikku-api/bin/modules/manga/handlers"
10
  "komikku-api/bin/pkg/middlewares"
 
15
  func main() {
16
  //Echo instance
17
  e := echo.New()
18
+
19
  e.Use(middleware.CORS())
20
  e.Use(middleware.Recover())
21
  e.Use(middlewares.Logger())
 
23
  comicHttp := mangaH.New()
24
  comicHttp.Mount(e)
25
 
26
+ chapterHttp :=chapterH.New()
27
  chapterHttp.Mount(e)
28
 
29
  e.GET("/", func(c echo.Context) error {
30
+ return utils.Response(map[string]string{"api-collection":"https://www.getpostman.com/collections/4c984c36d27bb591c445"}, "Get Collection", http.StatusOK, c)
31
  })
32
 
33
+ listenerPort := fmt.Sprintf(":%d", config.GlobalEnv.HTTPPort)
34
  e.Logger.Fatal(e.Start(listenerPort))
35
  }