0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2024-12-22 05:02:58 -05:00

Unix socket support

This commit is contained in:
dragongoose 2023-06-06 13:37:08 -04:00
parent 5c5da5404a
commit 14cf1284a1
No known key found for this signature in database
GPG key ID: 50DB99B921579009

View file

@ -48,6 +48,12 @@ func main() {
router.Use(ErrorHandler)
routes.SetRoutes(router)
router.NoRoute(notFoundHandler)
log.Println("Safetwitch API running")
router.Run()
env = os.Getenv("PORT")
if strings.Contains(env, "/") {
router.RunUnix(env)
} else {
router.Run()
}
}