mirror of
https://github.com/Neur0toxine/demo-web-service-go.git
synced 2024-12-04 18:46:03 +03:00
refactor app related code to the app package
This commit is contained in:
parent
7c781c064c
commit
660ff1a994
@ -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)
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package internal
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
@ -1,4 +1,4 @@
|
||||
package internal
|
||||
package app
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@ -1,4 +1,4 @@
|
||||
package internal
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
@ -1,4 +1,4 @@
|
||||
package internal
|
||||
package app
|
||||
|
||||
import (
|
||||
"log"
|
Loading…
Reference in New Issue
Block a user