Skip to content

Commit

Permalink
last one
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperninjaXII committed Nov 6, 2024
1 parent 62ebae9 commit ebc3169
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions api/index.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package handler
package main

import (
"log"
"net/http"

"github.com/gofiber/fiber/v2"
Expand All @@ -17,11 +16,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
return c.SendString("Hello from Fiber on Vercel!")
})

// Convert the Fiber app into an HTTP handler
http.Handle("/", app)

// Call the app handler
if err := app.Listen(":3000"); err != nil {
log.Fatal("Error starting server:", err)
}
// Fiber app's handler that implements http.Handler
handler := app
// Use the Fiber app's handler (which is an HTTP handler)
handler.ServeHTTP(w, r)
}

0 comments on commit ebc3169

Please sign in to comment.