rough skeleton and basic user authentication
This commit is contained in:
33
api/main.go
Normal file
33
api/main.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"zomo.dev/largehadroncollider/db"
|
||||
"zomo.dev/largehadroncollider/ttv"
|
||||
"zomo.dev/largehadroncollider/util"
|
||||
)
|
||||
|
||||
func InitApiServer(conf *util.Config, dbConn *db.DBConn, twitchConn *ttv.TwitchConn) (*ApiServer, error) {
|
||||
engine := gin.Default()
|
||||
|
||||
apiServer := &ApiServer{ engine, conf, dbConn, twitchConn }
|
||||
|
||||
apiServer.loadEndpoints()
|
||||
|
||||
return apiServer, nil
|
||||
}
|
||||
|
||||
type ApiServer struct {
|
||||
engine *gin.Engine
|
||||
conf *util.Config
|
||||
db *db.DBConn
|
||||
twitch *ttv.TwitchConn
|
||||
}
|
||||
|
||||
func (server *ApiServer) Listen() {
|
||||
server.engine.Run()
|
||||
}
|
||||
|
||||
func initHTMLFiles() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user