You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: .github/README.md
+32-33
Original file line number
Diff line number
Diff line change
@@ -215,8 +215,8 @@ func main() {
215
215
c.Next()
216
216
})
217
217
218
-
//POST /api/register
219
-
app.Post("/api/register", func(c *fiber.Ctx) {
218
+
//GET /api/register
219
+
app.Get("/api/list", func(c *fiber.Ctx) {
220
220
fmt.Println("Last middleware")
221
221
c.Send("Hello, World!")
222
222
})
@@ -311,22 +311,22 @@ Example:
311
311
```go
312
312
import (
313
313
"github.com/gofiber/fiber"
314
-
"github.com/gofiber/fiber/middleware"
314
+
"github.com/gofiber/logger"
315
315
)
316
316
317
317
funcmain() {
318
318
app:= fiber.New()
319
319
320
-
//If you want to change default Logger config
321
-
loggerConfig:=middleware.LoggerConfig{
320
+
//Optional logger config
321
+
config:=logger.LoggerConfig{
322
322
Format: "${time} - ${method} ${path}\n",
323
323
TimeFormat: "Mon, 2 Jan 2006 15:04:05 MST",
324
324
}
325
325
326
-
//Middleware for Logger with config
327
-
app.Use(middleware.Logger(loggerConfig))
326
+
// Logger with config
327
+
app.Use(logger.New(config))
328
328
329
-
// ...
329
+
app.Listen(3000)
330
330
}
331
331
```
332
332
@@ -336,25 +336,19 @@ Docs:
336
336
337
337
- 📖 https://fiber.wiki/middleware#cors
338
338
339
-
> [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own.
0 commit comments