photoprism/server/server.go

22 lines
380 B
Go
Raw Normal View History

package server
import (
"fmt"
2018-09-06 14:47:32 +02:00
"github.com/gin-gonic/gin"
2018-08-03 15:17:13 +02:00
"github.com/photoprism/photoprism"
)
func Start(address string, port int, mode string, conf *photoprism.Config) {
if mode != "" {
gin.SetMode(mode)
} else if conf.Debug == false{
gin.SetMode(gin.ReleaseMode)
}
app := gin.Default()
ConfigureRoutes(app, conf)
app.Run(fmt.Sprintf("%s:%d", address, port))
}