mirror of
https://github.com/trafficlunar/api.git
synced 2026-08-12 12:29:39 +00:00
refactor: move main.go to root directory
This commit is contained in:
parent
72fe3acb45
commit
9875e7c18f
1 changed files with 0 additions and 0 deletions
25
main.go
Normal file
25
main.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/lmittmann/tint"
|
||||
|
||||
"backend/internal/server"
|
||||
"backend/internal/worker"
|
||||
)
|
||||
|
||||
func main() {
|
||||
logger := slog.New(tint.NewHandler(os.Stderr, nil))
|
||||
slog.SetDefault(logger)
|
||||
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
slog.Warn("No .env file was found; using environment variables.", slog.Any("error", err))
|
||||
}
|
||||
|
||||
go worker.StartWorkers()
|
||||
server.NewRouter()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue