diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2026-02-11 00:54:05 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2026-02-11 00:54:05 +0500 |
| commit | 752f14c229096de283932f735f789b12a2d37753 (patch) | |
| tree | a4dd971c0e70d20f33e297c29f09b7e2845544eb /src | |
| parent | 27f6a10a809a20ac340d5023030f29fb4cc4764f (diff) | |
Docker
Diffstat (limited to 'src')
| -rw-r--r-- | src/Settings.json | 10 | ||||
| -rw-r--r-- | src/go.mod | 2 | ||||
| -rw-r--r-- | src/main.go | 22 | ||||
| -rwxr-xr-x | src/physick.ru | bin | 0 -> 15098992 bytes |
4 files changed, 19 insertions, 15 deletions
diff --git a/src/Settings.json b/src/Settings.json index 9700828..1f643d7 100644 --- a/src/Settings.json +++ b/src/Settings.json @@ -1,7 +1,7 @@ { - "Port": ":7000", - "StaticLocation": "../static", - "TemplatesLocation": "../templates", - "ArticlesLocation": "../articles", - "IndexDB": "../articles/index.db" + "Port": ":7000", + "StaticLocation": "static", + "TemplatesLocation": "templates", + "ArticlesLocation": "articles", + "IndexDB": "articles/index.db" } @@ -1,5 +1,5 @@ module physick.ru -go 1.25.4 +go 1.25.5 require github.com/mattn/go-sqlite3 v1.14.32 // indirect diff --git a/src/main.go b/src/main.go index 8091458..f176acc 100644 --- a/src/main.go +++ b/src/main.go @@ -12,6 +12,19 @@ import ( ) func main() { + setupLogging() + settings.ReadSettings() + index.EstablistDBConnection() + + render.RegisterEndpoints() + + var httpErr = http.ListenAndServe(settings.Current.Port, nil) + if httpErr != nil { + slog.Error("Server error", slog.Any("Message", httpErr)) + } +} + +func setupLogging() { var file, err = os.OpenFile("log.txt", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666) if err != nil { panic(fmt.Sprintf("Failed to open log file: %s", err.Error())) @@ -26,13 +39,4 @@ func main() { slog.SetDefault(slog.New(handler)) programLevel.Set(slog.LevelDebug) - settings.ReadSettings() - index.EstablistDBConnection() - - render.RegisterEndpoints() - - var httpErr = http.ListenAndServe(settings.Current.Port, nil) - if httpErr != nil { - slog.Error("Server error", slog.Any("Message", httpErr)) - } } diff --git a/src/physick.ru b/src/physick.ru Binary files differnew file mode 100755 index 0000000..c697375 --- /dev/null +++ b/src/physick.ru |
