Projects Structure Completed
This commit is contained in:
commit
338f508460
28 files changed
+567
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"restaurant-management/database"
|
||||
"restaurant-management/middleware"
|
||||
"restaurant-management/routes"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
|
||||
var foodCollection *mongo.Collection = database.OpenCollection(databse.Client, "food")
|
||||
|
||||
func main() {
|
||||
port := os.Getenv("PORT")
|
||||
|
||||
if port == "" {
|
||||
port = "8000"
|
||||
}
|
||||
|
||||
router := gin.New()
|
||||
router.Use(gin.Logger())
|
||||
routes.UserRoutes(router)
|
||||
router.Use(middleware.Authentication())
|
||||
|
||||
// Initialize routes
|
||||
routes.FoodRoutes(router)
|
||||
routes.MenuRoutes(router)
|
||||
routes.TableRoutes(router)
|
||||
routes.OrderRoutes(router)
|
||||
routes.OrderItemRoutes(router)
|
||||
routes.InvoiceRoutes(router)
|
||||
|
||||
router.run(":" + port)
|
||||
}
|
||||
Reference in new issue
Block a user