refactor app related code to the app package

This commit is contained in:
Pavel 2021-09-14 13:04:56 +03:00
parent 7c781c064c
commit 660ff1a994
5 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/Neur0toxine/demo-web-service-go/internal"
"github.com/Neur0toxine/demo-web-service-go/internal/app"
"github.com/brianvoe/gofakeit/v6"
)
@ -20,8 +20,8 @@ type RunCommand struct{}
func (c *RunCommand) Execute(args []string) error {
gofakeit.Seed(time.Now().UnixNano())
go internal.ProcessSignals()
r := internal.Router()
go app.ProcessSignals()
r := app.Router()
if err := r.Run(":8080"); err != nil {
return fmt.Errorf("cannot start the server on :8080 > %w", err)
}

View File

@ -1,4 +1,4 @@
package internal
package app
import (
"net/http"

View File

@ -1,4 +1,4 @@
package internal
package app
import (
"encoding/json"

View File

@ -1,4 +1,4 @@
package internal
package app
import (
"github.com/gin-gonic/gin"

View File

@ -1,4 +1,4 @@
package internal
package app
import (
"log"