2024-02-10 15:17:34 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/pikami/cosmium/api"
|
2024-02-13 23:47:51 +00:00
|
|
|
"github.com/pikami/cosmium/api/config"
|
2024-02-14 18:46:40 +00:00
|
|
|
"github.com/pikami/cosmium/internal/repositories"
|
2024-02-10 15:17:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-02-13 23:47:51 +00:00
|
|
|
config.ParseFlags()
|
2024-02-10 15:17:34 +00:00
|
|
|
|
2024-02-14 18:46:40 +00:00
|
|
|
if config.Config.DataFilePath != "" {
|
|
|
|
repositories.LoadStateFS(config.Config.DataFilePath)
|
|
|
|
}
|
|
|
|
|
2024-02-10 15:17:34 +00:00
|
|
|
router := api.CreateRouter()
|
2024-02-13 23:47:51 +00:00
|
|
|
router.RunTLS(
|
|
|
|
fmt.Sprintf(":%d", config.Config.Port),
|
|
|
|
config.Config.TLS_CertificatePath,
|
|
|
|
config.Config.TLS_CertificateKey)
|
2024-02-10 15:17:34 +00:00
|
|
|
}
|