Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/mmbednarek/smartapi

Package smartapi allows to quickly implement solid REST APIs in Golang. The idea behind the project is to replace handler functions with ordinary looking functions. This allows service layer methods to be used as handlers. Designation of a dedicated API layer is still advisable in order to map errors to status codes, write cookies, headers, etc. SmartAPI is based on github.com/go-chi/chi. This allows Chi middlewares to be used. This example returns a greeting with a name based on a query param `name`. But it's a good practice to use your own handler functions for your api. You can use SmartAPI with service layer methods as shown here. Middlewares can be used just as in Chi. `Use(...)` appends middlewares to be used. `With(...)` creates a copy of a router with chosen middlewares. Routing works similarity to Chi routing. Parameters can be prepended to be used in all endpoints in that route. Legacy handlers are supported with no overhead. They are directly passed as ordinary handler functions. No additional variadic arguments are required for legacy handler to be used.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/mmbednarek/smartapi
Keywords: api, go, golang, http, https, microservices, rest
License: MIT
Latest release: over 1 year ago
First release: almost 3 years ago
Namespace: github.com/mmbednarek
Stars: 9 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 16 days ago

    Loading...
    Readme
    Loading...