2022-08-22 01:36:13 +00:00
|
|
|
package main
|
|
|
|
|
2022-08-27 13:21:05 +00:00
|
|
|
import (
|
2022-09-19 11:11:36 +00:00
|
|
|
"github/fthvgb1/wp-go/actions/common"
|
2022-08-27 13:21:05 +00:00
|
|
|
"github/fthvgb1/wp-go/db"
|
|
|
|
"github/fthvgb1/wp-go/models"
|
2022-09-01 02:31:11 +00:00
|
|
|
"github/fthvgb1/wp-go/route"
|
2022-08-27 13:21:05 +00:00
|
|
|
"github/fthvgb1/wp-go/vars"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2022-08-28 14:08:16 +00:00
|
|
|
err := vars.InitConfig()
|
2022-08-27 13:21:05 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-09-23 13:46:34 +00:00
|
|
|
|
2022-08-27 13:21:05 +00:00
|
|
|
err = db.InitDb()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-09-23 13:46:34 +00:00
|
|
|
|
2022-09-01 02:31:11 +00:00
|
|
|
err = models.InitOptions()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-09-23 13:46:34 +00:00
|
|
|
|
2022-09-05 01:49:14 +00:00
|
|
|
err = models.InitTerms()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-09-23 13:46:34 +00:00
|
|
|
|
|
|
|
common.InitCache()
|
2022-08-27 13:21:05 +00:00
|
|
|
}
|
2022-08-22 01:36:13 +00:00
|
|
|
|
|
|
|
func main() {
|
2022-09-01 02:31:11 +00:00
|
|
|
err := route.SetupRouter().Run(":8082")
|
2022-08-27 13:21:05 +00:00
|
|
|
if err != nil {
|
2022-09-01 02:31:11 +00:00
|
|
|
panic(err)
|
2022-08-27 13:21:05 +00:00
|
|
|
}
|
2022-08-22 01:36:13 +00:00
|
|
|
}
|