chore: migrate to standard layout #5
4 changed files with 13 additions and 10 deletions
|
@ -1,11 +1,13 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/caarlos0/env/v11"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"rest_api/models"
|
|
||||||
"rest_api/router"
|
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
||||||
|
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/router"
|
||||||
|
|
||||||
|
"github.com/caarlos0/env/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -18,5 +20,4 @@ func main() {
|
||||||
|
|
||||||
log.Printf("Сервер запущен на порту: %s", config.Port)
|
log.Printf("Сервер запущен на порту: %s", config.Port)
|
||||||
http.ListenAndServe(":"+config.Port, router)
|
http.ListenAndServe(":"+config.Port, router)
|
||||||
|
|
||||||
}
|
}
|
11
go.mod
11
go.mod
|
@ -1,10 +1,11 @@
|
||||||
module rest_api
|
module code.alt-gnome.ru/aides-infra/aides-repo-api
|
||||||
|
|
||||||
go 1.23.3
|
go 1.23.3
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ajg/form v1.5.1 // indirect
|
github.com/caarlos0/env/v11 v11.2.2
|
||||||
github.com/caarlos0/env/v11 v11.2.2 // indirect
|
github.com/go-chi/chi/v5 v5.1.0
|
||||||
github.com/go-chi/chi/v5 v5.1.0 // indirect
|
github.com/go-chi/render v1.0.3
|
||||||
github.com/go-chi/render v1.0.3 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
require github.com/ajg/form v1.5.1 // indirect
|
||||||
|
|
|
@ -7,9 +7,10 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"rest_api/models" // Импорт пакета с моделями, где определены структуры конфигурации
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
||||||
|
|
||||||
"github.com/go-chi/render"
|
"github.com/go-chi/render"
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5" //Импорт пакета chi для маршрутизации
|
"github.com/go-chi/chi/v5" //Импорт пакета chi для маршрутизации
|
Loading…
Reference in a new issue