Update README.md

pull/198/head
Vic Shóstak 2020-03-01 18:51:33 +03:00 committed by GitHub
parent c79c3a35b6
commit 93b7792701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 24 deletions

48
.github/README.md vendored
View File

@ -201,30 +201,6 @@ func main() {
}
```
### Built-in logger
```go
import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)
func main() {
app := fiber.New()
// If you want to change default Logger config
loggerConfig := middleware.LoggerConfig{
Format: "${time} - ${method} ${path}\n",
TimeFormat: "Mon, 2 Jan 2006 15:04:05 MST",
}
// Middleware for Logger with config
app.Use(middleware.Logger(loggerConfig))
// ...
}
```
<details>
<summary>📚 Show more code examples</summary>
@ -287,6 +263,30 @@ func main() {
}
```
### Built-in logger
```go
import (
"github.com/gofiber/fiber"
"github.com/gofiber/fiber/middleware"
)
func main() {
app := fiber.New()
// If you want to change default Logger config
loggerConfig := middleware.LoggerConfig{
Format: "${time} - ${method} ${path}\n",
TimeFormat: "Mon, 2 Jan 2006 15:04:05 MST",
}
// Middleware for Logger with config
app.Use(middleware.Logger(loggerConfig))
// ...
}
```
### Cross-Origin Resource Sharing (CORS)
[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.