Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
github.com/vanackere/slim
Slim is a fork of Goji, a minimalistic web framework that values composability and simplicity.
func(ctx context.Context, w http.ResponseWriter, r *http.Request, next web.Handler)
package main
import (
"fmt"
"net/http"
"code.google.com/p/go.net/context"
"github.com/vanackere/slim"
"github.com/vanackere/slim/web"
)
func hello(ctx context.Context, w http.ResponseWriter, r *http.Request) {
p := web.URLParams(ctx)
fmt.Fprintf(w, "Hello, %s!", p["name"])
}
func main() {
slim.Get("/hello/:name", hello)
slim.Serve()
}
Slim also includes a sample application in the example
folder which
was artificially constructed to show off all of Slim's features. Check it out!
net/http
/foo/:bar
patterns and regular expressions,
as well as custom patterns)See Goji's README for why Goji's - and therore Slim's ! - approach is good.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.