beancount-gs/server.go

34 lines
470 B
Go
Raw Normal View History

2021-09-24 08:11:41 +00:00
package main
import (
"net/http"
2021-11-04 09:58:57 +00:00
"github.com/gin-gonic/gin"
2021-09-24 08:11:41 +00:00
)
2021-11-17 06:16:22 +00:00
func InitLedgerFiles() {
}
func LoadLedgerCache() {
}
func RegisterRoute(route *gin.Engine) {
route.StaticFS("/", http.Dir("./public"))
}
2021-09-24 08:11:41 +00:00
func main() {
2021-11-17 06:16:22 +00:00
// 默认端口号
var port = ":3001"
// 初始化账本文件结构
InitLedgerFiles()
// 加载缓存
LoadLedgerCache()
// 启动服务
2021-11-04 09:58:57 +00:00
route := gin.Default()
2021-11-17 06:16:22 +00:00
// 注册路由
RegisterRoute(route)
_ = http.ListenAndServe(port, nil)
2021-09-24 08:11:41 +00:00
}