-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
61 lines (48 loc) · 1.61 KB
/
Copy pathmain.go
File metadata and controls
61 lines (48 loc) · 1.61 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package main
func main() {
}
// import (
// "fmt"
// "net/http"
// "github.com/IzomSoftware/GinWrapper/internal/configuration"
// httpscore "github.com/IzomSoftware/GinWrapper/internal/https/core"
// "github.com/IzomSoftware/GinWrapper/internal/logger"
// "github.com/IzomSoftware/GinWrapper/internal/responses"
// "github.com/IzomSoftware/GinWrapper/internal/storage/redis_source"
// "github.com/IzomSoftware/GinWrapper/internal/storage/sql_source"
// "github.com/IzomSoftware/GinWrapper/internal/utils/jwt_util"
// "github.com/gin-gonic/gin"
// "github.com/sirupsen/logrus"
// )
// var (
// HttpsServer httpscore.HttpsServer
// )
// func main() {
// logger.SetupLogger("Test Website", logrus.DebugLevel)
// secret, _ := jwt_util.GenerateJWTRandomSecret(32)
// // Adjust as needed
// configuration.DefaultConfig.Protections.JWTProtection.JWTSecret = secret
// config := configuration.DefaultConfig
// // setup configuration
// configuration.SetupConfig("config.toml")
// // Intiialize storage sources
// sql_source.Init()
// redis_source.Init()
// // add responses
// responses.Responses["home"] = &responses.Response{
// Handler: func(c *gin.Context) {
// c.String(http.StatusOK, "")
// },
// Type: "GET",
// Addresses: []string{"/home"},
// Protections: responses.Protections{
// RateLimit: responses.RateLimitProtection{
// Enabled: true,
// Rate: 5,
// Time: 1,
// },
// },
// }
// // first argument is templateDir and second one is assetsDir
// HttpsServer.ListenAndServe(fmt.Sprintf("%s*", config.HTTPServer.TemplatesDir), config.HTTPServer.AssetsDir)
// }