Gem, a simple and fast web framework, it built top of fasthttp.
The API is currently unstable until the version v1.0.0
being released, see milestones for more details.
go get github.com/go-gem/gem
- Graceful shutdown and restart
- Listen multiple ports at single process
- Leveled logger
- High-performance and pretty router, very friendly to RESTful APIs
- Sessions support
- Various Middlewares:
- JSON WEB TOKEN middleware
- Compress middleware
- Basic Auth middleware
- Request Body Limit middleware
- CSRF middleware
- CORS middleware
I have sent a pull request, waiting for merging and rerunning the benchmark, see go-web-framework-benchmark for more information.
package main
import (
"log"
"github.com/go-gem/gem"
)
func main() {
log.Fatal(gem.ListenAndServe(":8080", func(c *gem.Context) {
c.HTML(200, "Hello world.")
}))
}
Run the code above, and then navigate to 127.0.0.1:8080.
Gem follows semantic versioning 2.0.0 managed through GitHub releases.
- ⭐ the project.
- Spread the word.
- Contribute to the project.
- Report issues
- Send PRs.
- Improve/fix documentation.
We’re always looking for help, so if you would like to contribute, we’d love to have you!
Just for figuring out the web framework's workflow, and try to design a simple and strong web framework.
- tests - a tests package for fasthttp and Gem.
- sessions - a sessions manager package for fasthttp.
- log - a simple, leveled logging package.
-
What should I pay attention to?
At present, Gem is incompatible with some APIs of fasthttp, the incompatible APIs following:
- fasthttp.TimeoutHandler
-
What is the difference between of fasthttp and gem?
Gem built on top of fasthttp, and use
Server.ServeConn
to serve connections, it can not works without fasthttp.Advantages:
Gem provides some useful built-in features, such as:
- High-performance router
- Leveled logger
- Various middlewares
- Sessions support
- Graceful shutdown and restart
Disadvantages:
at present, Gem dose not provide APIs to Serve the custom
Listener
likefasthttp.Serve
, but that will not be a problem, We will add support for this feature in the future.
MIT licensed. See LICENSE file for more information.
Inspiration & Credits
I have read the code of the following open source projects, and integrate their designs into this project.
I respect these projects and it's authors, and follow their LICENSE.
If your LICENSE is missing, please contact me, I will add it ASAP.