30 lines
462 B
Go
30 lines
462 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/SowinskiBraeden/school-management-api/routes"
|
|
"github.com/joho/godotenv"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
"github.com/gofiber/fiber/v2/middleware/cors"
|
|
)
|
|
|
|
const version string = "\nv1.1.3-Beta"
|
|
|
|
func main() {
|
|
fmt.Println(version)
|
|
app := fiber.New()
|
|
|
|
app.Use(cors.New(cors.Config{
|
|
AllowCredentials: true,
|
|
}))
|
|
|
|
routes.Setup(app)
|
|
|
|
godotenv.Load(".env")
|
|
port := os.Getenv("PORT")
|
|
app.Listen(":" + port)
|
|
}
|