gofiber / docs Goto Github PK
View Code? Open in Web Editor NEWπ Documentation for π Fiber
Home Page: https://docs.gofiber.io
License: Apache License 2.0
π Documentation for π Fiber
Home Page: https://docs.gofiber.io
License: Apache License 2.0
hi,
2 links are not working on https://docs.gofiber.io/api
one is used on https://docs.gofiber.io/api/ctx#links
in content "the responseβs Link HTTP header field."
https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Link
second link below is not working and it is used on https://docs.gofiber.io/api/ctx#next
https://github.com/gofiber/docs/tree/aa2680660c0b661b8e9d215b32cb03e766277131/api/error-handling.md
The Portuguese translation seems to be in Brazilian Portuguese so it would make more sense to change the flag to a Brazilian one.
With this change, the flag would also match with the one shown in the translation platform.
If you guys agree, I'd be willing to make a PR for it.
Hello. Should I create a new branch "es" and create a pull request for it?
The type signature of Ctx.Locals()
according to the docs:
func (c *Ctx) Locals(key string, value ...interface{}) interface{}
Looks like this method signature was updated as of v2.40.0 to accept a key interface:
func (c *Ctx) Locals(key interface{}, value ...interface{}) (val interface{})
It seems there's no doc for monitor. If you'll add this doc, i can open PR.
app.Get("/", func(c *fiber.Ctx) {
c.Redirect("/foo/bar")
c.Redirect("../login")
c.Redirect("http://example.com")
c.Redirect("http://example.com", 301)
})
Does it has to be either host or path-only? Can it be host + path?
I tried c.Redirect("http://10.xx.xx.xx:3000/login")
but got
Oops!
404 Not Found
Sorry, an error has occured, Requested page not found!
Visiting that url directly within my browser OK.
Is the problem of host + path, or host + path + port?
Thx!
Config
app.Use(logger.New(logger.Config{
Format: "[${pid}]:${port} ${status} - ${method} ${path}\n",
TimeFormat: "2006-01-02T15:04:05.0Z",
TimeZone: "Asia/Ho_Chi_Minh",
}))
Output
2021-11-12T09:29:26.4Z | 200 | 0s | 127.0.0.1 | GET | /hello
Config
app.Use(logger.New(logger.Config{
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
}))
Output
09:44:28 | 200 | 0s | 127.0.0.1 | GET | /hello
I think this is a bug! Did I miss something?
Hello,
I see theres a trailing }
in the regex constraints on this docs page: https://docs.gofiber.io/next/guide/routing#constraints
I'm not sure if that is intended or not, but it seems to work without that. If it's not intended, I can open a PR to remove that.
Is https://github.com/gofiber/docs/blob/master/original/routing.md#parameters the only way to handle query parameters? Unlike
GET /user/:name/books/:title
I need all route parameters to be optional. E.g.,
https://mysite.com/?page=2&limit=3&sort=price
What if I just need to specify the last one? (no matter how you arrange the route parameters orders, there will always be a last one)
How to deal with situation like this?
Please help. Thanks a lot!
I had an idea to create a small, square form factor, logo of Fiber.
I was thinking about having the three identifiable blue stripes and maybe the letter F.
This logo could be useful for i.e. favicons and icons or avatars.
Let me know what you thing about this idea!
I have been using Fiber for over 2 months now, and everyday I find myself re-inventing the wheel because I didnt know Fiber had a Util function for doing X task.
It would be very beneficial if basic documentation could be added to document all the very useful Fiber Utils.
No response
No response
I use redis as session middleware service. But get error when reload page or open a new page if my script get session info
Here is the error alert: [session] Register this type first with the `RegisterType` method.
This error also happen when restart server
I have to restart server, clear history, restart redis to continue working
Hi evereyone can we have example in grouping.md
that show we can group router by params
something like this or example more simple
func main() {
app := fiber.New()
api := app.Group("/api") // /api
v1 := api.Group("/v1") // /api/v1
user := api.Group("/user")
userID := user .Group("/:userID")
v1.Get("/list", handler) // /api/v1/list
user.Get("/", handler) // /api/v1/user
userID.Get("/profile",handler) // /api/v1/user/1/profile
userID.Put("/update",handler) // /api/v1/user/1/update
log.Fatal(app.Listen(":3000"))
}
Docusaurus 2 is fast, flexible and free documentation generator. I think it would be better if we use Docusaurus instead of Gitbook. Gitbook isn't open source and a bit slow in mobile devices. Check out https://docusaurus.io/. I think we can use it by closing homepage, blog features.
What do you think?
Any suggestion?
I thought something like that
explain possibles constants to use on Fiber
fiber.<constant>
e.g
fiber.StatusInternalServerError // get status errors 500 respect RFC XYZ all list to use Status Code can you based on IANA
list constants: we can show as a table
show list below
The example provided for ctx.Location
here indicates that Location
doesn't have a return value in its signature, however in the code below c.Location("/test")
is returned. This code fails to compile.
Ref. https://github.com/gofiber/docs/blob/master/guide/validation.md?plain=1#L22
Validation will fail when the passed is_active
value is false
Like they say in this issue response:
required
-under the hood checks if the value of the field is the default value of the datatype; in this case of a bool false.type
bool
will always be populated and sorequired
doesn't make sense. Now having said that, you may be looking to validate that the JSON set the bool, then there are things you can do.change the type to
*bool
and now the type is a pointer, and it's default value isnil
and sorequired
will work as most people expect if the data wasn't in the JSON.
I'm providing a fix to the documentation π
Hi,
It's not possible to copy-paste portions of the example code. Am I the only one experiencing this problem?
I'm using Firefox. Thanks!
Update docs with info about gofiber/fiber#2052
For example, there is a benchmarks.md
file in the following three dirs of this repo:
Why is that? Can two of them be cleaned up?
There is a lack of tutorials for new users. There are guides to certain things(recipes) and example projects but they don't cover new starters.
A lot of other projects rely on having tutorials/guides on how to use it on 3rd party websites which might be deleted or be behind it's own paywall. Having a blog/tutorial created by the fiber team would ensure high quality as each maintainer is aware of why the code works in the way it does to better assist newer developers and increase adoption of Fiber.
In my opinion what I would like to see as part of a series:
app.Test()
)[https://docs.gofiber.io/api/app#test] and the (Unit Test recipe
)[https://github.com/gofiber/recipes/tree/master/unit-test] into it's own section for Testing and Benchmarkingplease can you add an option or toggle for readers to be able to see the documentation with a dark mode/theme colours.
The Fiber API Documentation has a typo on the TrustedProxies
section:
Contains the list op trusted proxy IP's. Look at EnableTrustedProxyCheck doc.
I think it should be "Contains the list of
trusted proxy IP's"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.