fix: move shit to parent folder
This commit is contained in:
parent
7a5d8edfc6
commit
7d869ea36d
6 changed files with 3 additions and 0 deletions
37
main.go
Normal file
37
main.go
Normal file
|
@ -0,0 +1,37 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"log"
|
||||
"os"
|
||||
"stereo.cat/backend/internal/api"
|
||||
"stereo.cat/backend/internal/types"
|
||||
)
|
||||
|
||||
func getEnv(key, fallback string) string {
|
||||
if value, ok := os.LookupEnv(key); ok {
|
||||
return value
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
func main() {
|
||||
imagePath := getEnv("IMAGE_PATH", "/tmp")
|
||||
|
||||
if _, err := os.Stat(imagePath); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(imagePath, os.ModePerm); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c := types.StereoConfig{
|
||||
Router: gin.Default(),
|
||||
ImagePath: imagePath,
|
||||
}
|
||||
|
||||
api.Register(&c)
|
||||
|
||||
c.Router.Run()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue