add bb_api rest api for begushiybashkir
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"go-rest-api/internal/config"
|
||||
"go-rest-api/internal/routes"
|
||||
"go-rest-api/pkg/database"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Load configuration
|
||||
cfg := config.Load()
|
||||
|
||||
// Initialize database
|
||||
db, err := database.InitDB(cfg.DatabaseURL)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to connect to database:", err)
|
||||
}
|
||||
|
||||
// Initialize router
|
||||
router := routes.SetupRouter(db)
|
||||
|
||||
log.Printf("Server starting on port %s", cfg.Port)
|
||||
log.Fatal(http.ListenAndServe(":"+cfg.Port, router))
|
||||
}
|
||||
Reference in New Issue
Block a user