gofiber / boilerplate Goto Github PK
View Code? Open in Web Editor NEW๐ง Boilerplate for ๐ Fiber
Home Page: https://github.com/gofiber/fiber
License: MIT License
๐ง Boilerplate for ๐ Fiber
Home Page: https://github.com/gofiber/fiber
License: MIT License
The current app.go
sometimes doesn't bind to 0.0.0.0
but rather, binds to 127.0.0.1
which will not work with requests from outside the container when the port is exposed i.e. docker run .. -p 3000:3000
.
To fix this, in app.go Line 32 change listen from
app.Listen(3000)
to:
app.Listen("0.0.0.0:3000")
Hi there, I just got started with Fiber today. My own experiments worked fine, but trying out this boilerplate app looked wrong. When entering a couple of user names and then doing a reload the list seem to be the same strings with varying length. That looks to me that the buffer is not handled correctly.
changing the following in database.go
seems to fix it
func UserCreate(c *fiber.Ctx) error {
user := &models.User{
Name: utils.ImmutableString(c.FormValue("user")),
}
//...
I just wanted to confirm that this is correct and the right place - and I'm not missing something blindingly obvious as a beginner
Hello
maybe this is just a little suggestion why the router is not separated in the router folder?
I made boilerplate for fiber as well as this https://github.com/firmanJS/boillerplate-fiber might be checked and considered
thank you
First, I want to thank you for sharing this boilerplate. I just started to get to know Fiber and this was a great help. Thank you so much!
I did find the Dockerfile you are using a bit complicated - I know it is an example from the Docker documentation and it does work. The first problem that I ran into was that the image generated in the second step - in the scope of my Docker abilities - could not be renamed. So I always ended up with a generic ID (makes it a bit more complicated to add the image into a Docker-Compose or Kubernetes workflow). And then there is the issue of keeping the container running in the background.
Is there a reason behind the setup you choose that I am not seeing? Or is this a better solution:
First of all, thanks for providing this truly helpful project, so that people like me can learn how a gofiber based web app can/should be architected. I'm still in the process of wrapping my head around how things work, and would appreciate if the following use-cased can be covered as well.
GET
page, where the dynamic content is served based on a local static user.html file.redirect
. I want my /
page a redirect one, so that I can easily redirect to /v2/
if things are ready. So maybe rename static/public/index.html
as static/public/index-v1.html
and redirect to it from /
page?Thanks for considerations/helps.
Docker image will crash in Prefork mode without dumb-init packge
Add: RUN apk add dumb-init to docker file in order to solve issue.
Line 19 in 72bb783
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.