package main

import (
	"log"

	"mengpost-backend/config"
	"mengpost-backend/database"
	"mengpost-backend/router"
)

func main() {
	cfg := config.Load()
	database.Init(cfg.DBPath)
	r := router.New(cfg)
	log.Printf("萌邮 MengPost backend listening on :%s (token=%s)", cfg.Port, cfg.Token)
	if err := r.Run(":" + cfg.Port); err != nil {
		log.Fatal(err)
	}
}
