-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (27 loc) · 674 Bytes
/
main.go
File metadata and controls
38 lines (27 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"ecommerce-backend/config"
"ecommerce-backend/router"
"log"
"github.com/joho/godotenv"
)
// @title eCommerceGo Backend
// @version 0.1
// @description This is a ecommerce backend built in Go.
// @contact.email vigasdeep@gmail.com
// @license.name MIT
// @host localhost:8080
// @BasePath /
// @securityDefinitions.basic BasicAuth
// @externalDocs.description OpenAPI
func main() {
err := godotenv.Load()
if err != nil {
log.Print("Error loading .env file")
}
config.InitDB()
InitializeDatabase()
r := router.SetupRouter()
// Start the server
r.Run(":8080") // listen and serve on 0.0.0.0:8080
}