Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

story(issue-248): endpoint make endpoint creation fully declarative #249

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)
[![Go Reference](https://pkg.go.dev/badge/github.com/z5labs/bedrock.svg)](https://pkg.go.dev/github.com/z5labs/bedrock)
[![Go Report Card](https://goreportcard.com/badge/github.com/z5labs/bedrock)](https://goreportcard.com/report/github.com/z5labs/bedrock)
![Coverage](https://img.shields.io/badge/Coverage-95.0%25-brightgreen)
![Coverage](https://img.shields.io/badge/Coverage-95.3%25-brightgreen)
[![build](https://github.com/z5labs/bedrock/actions/workflows/build.yaml/badge.svg)](https://github.com/z5labs/bedrock/actions/workflows/build.yaml)

**bedrock provides a minimal, modular and composable foundation for
Expand Down
7 changes: 4 additions & 3 deletions example/simple_rest/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package app
import (
"context"
"log/slog"
"net/http"
"os"

"github.com/z5labs/bedrock"
Expand Down Expand Up @@ -39,10 +40,10 @@ func Init(ctx context.Context, cfg Config) (bedrock.App, error) {

restApp := rest.NewApp(
rest.ListenOn(cfg.Http.Port),
rest.Handle(
rest.Endpoint(
http.MethodPost,
"/echo",
endpoint.Post(
"/echo",
endpoint.NewOperation(
echoService,
endpoint.Headers(
endpoint.Header{
Expand Down
Loading