intial commit
This commit is contained in:
57
mainOLD copy.go
Normal file
57
mainOLD copy.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package main
|
||||
|
||||
// import (
|
||||
// "strings"
|
||||
|
||||
// "nearle/db"
|
||||
// "nearle/routes"
|
||||
|
||||
// "github.com/gofiber/fiber/v2"
|
||||
// "github.com/gofiber/fiber/v2/middleware/cors"
|
||||
// )
|
||||
|
||||
// var (
|
||||
// router = fiber.New()
|
||||
// )
|
||||
|
||||
// func main() {
|
||||
|
||||
// //app := fiber.New()
|
||||
|
||||
// router.Use(cors.New(cors.Config{
|
||||
// AllowHeaders: "Origin,Content-Type,Accept,Content-Length,Accept-Language,Accept-Encoding,Connection,Access-Control-Allow-Origin",
|
||||
// AllowOrigins: "*",
|
||||
// AllowCredentials: true,
|
||||
// AllowMethods: "GET,POST,HEAD,PUT,DELETE,PATCH,OPTIONS",
|
||||
// }))
|
||||
|
||||
// router.Use(handler)
|
||||
|
||||
// routes.DevSetup(router)
|
||||
// routes.LiveSetup(router)
|
||||
|
||||
// router.Listen(":1009")
|
||||
|
||||
// }
|
||||
|
||||
// func handler(c *fiber.Ctx) error {
|
||||
|
||||
// path := c.Path()
|
||||
// result := strings.Split(path, "/")
|
||||
// var flavour string
|
||||
|
||||
// for _ = range result {
|
||||
// flavour = result[1]
|
||||
// }
|
||||
// if flavour == "dev" {
|
||||
|
||||
// db.DevConnect()
|
||||
|
||||
// } else if flavour == "live" {
|
||||
|
||||
// db.LiveConnect()
|
||||
// defer db.CloseDB()
|
||||
|
||||
// }
|
||||
// return c.Next()
|
||||
// }
|
||||
Reference in New Issue
Block a user