-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
37 lines (32 loc) · 789 Bytes
/
main.go
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
package main
import (
"Mini-Project_SiBaBe/config"
"Mini-Project_SiBaBe/model"
"Mini-Project_SiBaBe/route"
"Mini-Project_SiBaBe/service"
"os"
"github.com/joho/godotenv"
)
func init() {
err := godotenv.Load(".env")
if err != nil {
panic(err)
}
}
func main() {
var (
db = config.InitDatabase()
PORT = os.Getenv("PORT")
customerSvc = service.NewCustomerService(db)
adminSvc = service.NewAdminService(db)
)
model.DB.AutoMigrate(
&model.Customer{}, &model.Admin{}, &model.Produk{},
&model.Keranjang{}, &model.Produk_Keranjang{},
&model.Produksi{}, &model.Pemesanan{},
&model.Admin_Pemesanan{}, &model.Feedback_Pemesanan{},
&model.Feedback{}, &model.Laporan_Keuangan{},
)
app := route.New(customerSvc, adminSvc)
app.Start(":" + PORT)
}