2021-08-26 16:16:50 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
2021-08-26 17:32:19 +03:00
|
|
|
_ "github.com/joho/godotenv/autoload"
|
2021-08-26 16:16:50 +03:00
|
|
|
|
|
|
|
Config "micrach/config"
|
|
|
|
// Controllers "micrach/controllers"
|
|
|
|
Db "micrach/db"
|
|
|
|
// Utils "micrach/utils"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
Config.Init()
|
|
|
|
Db.Init()
|
|
|
|
defer Db.Pool.Close()
|
|
|
|
gin.SetMode(Config.App.Env)
|
|
|
|
|
|
|
|
router := gin.Default()
|
|
|
|
// router.GET("/boards", Controllers.GetAllBoards)
|
|
|
|
// router.GET("/threads/:boardId", Controllers.GetThreads)
|
|
|
|
// router.POST("/threads/:boardId", Controllers.CreateThread)
|
|
|
|
// router.POST("/posts/:boardId/:threadId", Controllers.CreatePost)
|
|
|
|
|
|
|
|
log.Println("all systems nominal")
|
|
|
|
|
|
|
|
router.Run("localhost:" + strconv.Itoa(Config.App.Port))
|
|
|
|
}
|