-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (28 loc) · 749 Bytes
/
Copy pathmain.go
File metadata and controls
38 lines (28 loc) · 749 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 (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"webstore/src/database"
"webstore/src/routes"
)
/// TODO
/// 1. Check if email already exists
/// 2. Connect user orders
func main() {
database.ConnectDB()
database.SetupRedis()
database.SetupCacheChannel()
app := fiber.New()
app.Static("/", "./public")
app.Use(cors.New(cors.Config{
AllowCredentials: true,
AllowOrigins: "https://127.0.0.1:8000, http://127.0.0.1:8000, http://localhost:8000, http://localhost:3000,",
AllowHeaders: "Origin, Content-Type, Accept",
}))
routes.Setup(app)
//go database.ClearCache("productsFrontend", "productsBackend")
err := app.Listen(":8000")
if err != nil {
return
}
}