-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
37 lines (33 loc) · 1009 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 (
"github.com/goylold/lowcode/chat"
"github.com/goylold/lowcode/embeddings"
"github.com/goylold/lowcode/explain"
"github.com/goylold/lowcode/image"
"github.com/goylold/lowcode/utils"
"github.com/goylold/lowcode/web"
"net/http"
"github.com/goylold/lowcode/database"
"github.com/gin-gonic/gin"
"github.com/goylold/lowcode/config"
"github.com/goylold/lowcode/logger"
"github.com/goylold/lowcode/middleware"
routes "github.com/goylold/lowcode/routes"
"github.com/goylold/lowcode/validator"
)
func main() {
database.LoadDatabase()
logger.InitLogger()
validator.Init()
configBase := config.GetConConfig()
router := gin.Default()
router.Use(middleware.Auth())
router.StaticFS("/upload", http.Dir(utils.GetFilePath(configBase.Service.UploadDir)))
routes.RouterRegister(router)
chat.RouteRegister(router)
embeddings.RouteRegister(router)
image.RouteRegister(router)
web.RouteRegister(router)
explain.RouteRegister(router)
router.Run(":" + configBase.Service.Port)
}