This repository has been archived on 2026-01-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cover-letter-templater/backend/main.go
2025-07-05 21:11:09 +03:00

34 lines
468 B
Go

package main
import (
"backend/config"
"backend/db"
"backend/routes"
"log"
"os"
)
func main() {
// Load env variables
env := config.LoadEnv()
// Connect to database
err := db.Connect(env["db"])
if err != nil {
os.Exit(1)
}
// Migrate database if needed
err = db.Migrate()
if err != nil {
os.Exit(1)
}
// Setup routes
routes := routes.SetupRoutes()
// Listen on port smth
log.Printf("Starting server ...")
log.Fatal(routes.Run(":8080"))
}