1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-23 20:44:00 +00:00
This commit is contained in:
Fenny 2020-01-14 05:46:21 +01:00
parent 2184b7c9b5
commit ce76255d4e

View File

@ -35,11 +35,11 @@ package main
import "github.com/fenny/fiber"
func main() {
app := fiber.New()
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})
app.Listen(8080)
app := fiber.New()
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})
app.Listen(8080)
}
```
```shell
@ -74,22 +74,22 @@ The following examples illustrate defining simple routes.
```go
// Respond with Hello, World! on the homepage:
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
c.Send("Hello, World!")
})
//Respond to POST request on the root route (/), the applications home page:
app.Post("/", func(c *fiber.Ctx) {
c.Send("Got a POST request")
c.Send("Got a POST request")
})
// Respond to a PUT request to the /user route:
app.Put("/user", func(c *fiber.Ctx) {
c.Send("Got a PUT request at /user")
c.Send("Got a PUT request at /user")
})
// Respond to a DELETE request to the /user route:
app.Delete("/user", func(c *fiber.Ctx) {
c.Send("Got a DELETE request at /user")
c.Send("Got a DELETE request at /user")
})
```