Login and main router with jwt tokens
This commit is contained in:
1 parent
7049abf5d8
commit
0a357a7c2b
6 files changed
+219
-26
No files matched your search
@@ -1,19 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"school-management/database"
|
||||
|
||||
"school-management/routes"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
)
|
||||
|
||||
var studentCollection *mongo.Collection = database.OpenCollection(database.Client, "students")
|
||||
|
||||
func main() {
|
||||
app := fiber.New()
|
||||
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowCredentials: true,
|
||||
}))
|
||||
|
||||
routes.Setup(app)
|
||||
|
||||
app.Listen(":8000")
|
||||
|
||||
Reference in new issue
Block a user