feat(backend): env added

This commit is contained in:
2025-07-16 21:56:17 -05:00
parent 4ef2d90aa8
commit 67b5976176
2 changed files with 15 additions and 4 deletions

View File

@@ -2,22 +2,32 @@ package main
import (
"fmt"
"log"
"net/http"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
)
func main() {
err := godotenv.Load("../.env")
if err != nil {
log.Fatal("Error loading .env file")
}
// name := os.Getenv("LSTV2")
// fmt.Println(name)
fmt.Println("Welcome to lst backend where all the fun happens.")
r := gin.Default()
// Serve Docusaurus static files
r.StaticFS("/lst/docs", http.Dir("docs"))
r.StaticFS("/lst/docs", http.Dir("docs"))
r.GET("/api/ping", func(c *gin.Context) {
c.JSON(200, gin.H{"message": "pong"})
})
c.JSON(200, gin.H{"message": "pong"})
})
r.Any("/api", errorApiLoc)
r.Any("/", errorLoc)