view main.go @ 13:e7ab74d2ad88 default tip

Move to mercurial
author Dennis C. M. <dennis@denniscm.com>
date Wed, 04 Jun 2025 09:38:35 +0100
parents aaf85ae1f942
children
line wrap: on
line source

package main

import (
	"github.com/denniscmcom/pacobot/api"
	"github.com/denniscmcom/pacobot/app"
	"github.com/gin-gonic/gin"
)

func main() {
	gin.SetMode(gin.DebugMode)

	r := gin.Default()
	r.LoadHTMLGlob("./www/**/*.html")
	r.Static("/static", "./www/static")

	r.GET("/", app.Index)

	{
		apiG := r.Group("/api")
		apiG.GET("/user", api.GetUser)
		apiG.GET("/connect", api.Connect)

		{
			authG := apiG.Group("/auth")
			authG.GET("/", api.Auth)
			authG.GET("/validate", api.AuthValidate)
			authG.GET("/refresh", api.AuthRefresh)
			authG.GET("/revoke", api.AuthRevoke)
			authG.GET("/twitch", api.Twitch)
		}

	}

	r.Run()
}