gofiber / embed Goto Github PK
View Code? Open in Web Editor NEW⚠ Deprecated, available within Fiber v2
Home Page: https://github.com/gofiber/fiber/tree/master/middleware/filesystem
License: MIT License
⚠ Deprecated, available within Fiber v2
Home Page: https://github.com/gofiber/fiber/tree/master/middleware/filesystem
License: MIT License
We might want to add this feature when embedding and/or serving static files.
See RFC7232 Section 2.3 and this question on Stack Overflow.
Hi,
it would be great if you could add an example on how to serve a single page application with this middleware
// Example of how to use rakyll/statik to embed the binary in your executable
// go get github.com/rakyll/statik
// statik -src = <Your html>/
package main
import (
"log"
"github.com/gofiber/embed"
"github.com/gofiber/fiber"
"<Your go module>/statik"
"github.com/rakyll/statik/fs"
)
func main() {
statikFS, err := fs.New()
if err != nil {
log.Fatal(err)
}
app := fiber.New()
app.Use("/", embed.New(embed.Config{
Root: statikFS,
}))
app.Listen(8080)
}
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.