Perbaikan pembacaan data base
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
||||
|
||||
"api-service/internal/server"
|
||||
|
||||
"github.com/joho/godotenv" // Import the godotenv package
|
||||
|
||||
_ "api-service/docs"
|
||||
)
|
||||
|
||||
@@ -58,6 +60,11 @@ func gracefulShutdown(apiServer *http.Server, done chan bool) {
|
||||
func main() {
|
||||
log.Println("Starting API Service...")
|
||||
|
||||
// Load environment variables from .env file
|
||||
if err := godotenv.Load(); err != nil {
|
||||
log.Fatal("Error loading .env file")
|
||||
}
|
||||
|
||||
server := server.NewServer()
|
||||
|
||||
// Create a done channel to signal when the shutdown is complete
|
||||
|
||||
Reference in New Issue
Block a user