You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@
4
4
5
5
**A typed web framework for MoonBit — `← FastAPI`.**
6
6
7
-
[](https://github.com/Lfan-ke/moonapi/actions/workflows/ci.yml)
7
+
[](https://github.com/moonbitstack/moonapi/actions/workflows/ci.yml)
`moonapi` builds an [`AsgiApp`](https://github.com/Lfan-ke/moonasgi) from typed routes and generates its own **OpenAPI / Swagger** document — the role FastAPI plays for Python. It depends only on `moonasgi`, so it's backend-agnostic (routing and OpenAPI run in-process on every backend); a server such as [`mooncat`](https://github.com/Lfan-ke/mooncat) runs the resulting app.
13
+
`moonapi` builds an [`AsgiApp`](https://github.com/moonbitstack/moonasgi) from typed routes and generates its own **OpenAPI / Swagger** document — the role FastAPI plays for Python. It depends only on `moonasgi`, so it's backend-agnostic (routing and OpenAPI run in-process on every backend); a server such as [`mooncat`](https://github.com/moonbitstack/mooncat) runs the resulting app.
<main><headerclass="hero"><h1>moonapi</h1><pclass="tag">A typed web framework for MoonBit — FastAPI-style routing and multi-version OpenAPI, on the moonasgi SEAM. Backend-agnostic — the async transport lives in the server (mooncat) that runs the app.</p><divclass="badges"><ahref="https://github.com/Lfan-ke/moonapi/actions"><imgalt="CI" src="https://img.shields.io/github/actions/workflow/status/Lfan-ke/moonapi/ci.yml?branch=master&label=CI&logo=github"></a><imgalt="tests" src="https://img.shields.io/badge/tests-86%20passing%20%C3%974%20backends-0ca678"><ahref="https://github.com/Lfan-ke/moonapi"><imgalt="GitHub" src="https://img.shields.io/badge/GitHub-source-24292f?logo=github"></a><imgalt="license" src="https://img.shields.io/badge/license-Apache--2.0-6d5efc"></div><divclass="install"><spanclass="prompt">$</span><code>moon add Lfan-ke/moonapi</code><buttonclass="copy" data-copy="moon add Lfan-ke/moonapi">copy</button></div><divclass="contract"><h2><spanclass="spark">✶</span> The contract at a glance</h2><pre><spanclass="k">let</span> app = <spanclass="ty">App</span>::new()
<main><headerclass="hero"><h1>moonapi</h1><pclass="tag">A typed web framework for MoonBit — FastAPI-style routing and multi-version OpenAPI, on the moonasgi SEAM. Backend-agnostic — the async transport lives in the server (mooncat) that runs the app.</p><divclass="badges"><ahref="https://github.com/moonbitstack/moonapi/actions"><imgalt="CI" src="https://img.shields.io/github/actions/workflow/status/moonbitstack/moonapi/ci.yml?branch=master&label=CI&logo=github"></a><imgalt="tests" src="https://img.shields.io/badge/tests-86%20passing%20%C3%974%20backends-0ca678"><ahref="https://github.com/moonbitstack/moonapi"><imgalt="GitHub" src="https://img.shields.io/badge/GitHub-source-24292f?logo=github"></a><imgalt="license" src="https://img.shields.io/badge/license-Apache--2.0-6d5efc"></div><divclass="install"><spanclass="prompt">$</span><code>moon add Lfan-ke/moonapi</code><buttonclass="copy" data-copy="moon add Lfan-ke/moonapi">copy</button></div><divclass="contract"><h2><spanclass="spark">✶</span> The contract at a glance</h2><pre><spanclass="k">let</span> app = <spanclass="ty">App</span>::new()
<spanclass="k">let</span> spec = app.openapi_json(version=<spanclass="ty">OpenApi31</span>) // also <spanclass="ty">OpenApi30</span> / <spanclass="ty">Swagger20</span>
@@ -412,7 +412,7 @@
412
412
<divclass="item" data-k="enum"><spanclass="kind">enum</span><preclass="sig"><spanclass="k">enum</span><spanclass="ty">Dep</span></pre><pclass="doc">The dependency value type of the greet app. A sum type wrapping every dependency this app injects — the explicit, exhaustive stand-in for FastAPI resolving heterogeneous <code>Depends</code> values dynamically.</p></div>
413
413
<divclass="item" data-k="fn"><spanclass="kind">fn</span><preclass="sig"><spanclass="k">fn</span> greet_app(container : <spanclass="ty">Container</span>[<spanclass="ty">Dep</span>]) <spanclass="op">-></span><spanclass="ty">App</span></pre><pclass="doc">Build the greet application over a caller-supplied dependency <code>container</code>, so a test can register <code>dependency_overrides</code> on the same container before or between requests. <code>POST /greet</code> resolves the <code>"greeting"</code> dependency, reads a validated <code>GreetReq</code> body, and answers <code>{"message": "<greeting>, <name>"}</code>; a malformed body gets a FastAPI-shaped <code>422</code>. The dependency scope brackets each request, so any <code>yield</code> teardown runs once the handler returns.</p></div>
414
414
</section>
415
-
<footer>Generated from source <code>///</code> doc-comments · <ahref="https://mooncakes.io/docs/Lfan-ke/moonapi">mooncakes</a> · <ahref="https://github.com/Lfan-ke/moonapi">GitHub</a> · Apache-2.0 © Leo Cheng</footer>
415
+
<footer>Generated from source <code>///</code> doc-comments · <ahref="https://mooncakes.io/docs/Lfan-ke/moonapi">mooncakes</a> · <ahref="https://github.com/moonbitstack/moonapi">GitHub</a> · Apache-2.0 © Leo Cheng</footer>
Copy file name to clipboardExpand all lines: examples/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ moon run examples/01-openapi
10
10
11
11
Everything runs in-process through `App::handle` / `drive_websocket`, so every
12
12
example works on every backend; a server such as
13
-
[`mooncat`](https://github.com/Lfan-ke/mooncat) runs the same `App::to_asgi`
13
+
[`mooncat`](https://github.com/moonbitstack/mooncat) runs the same `App::to_asgi`
14
14
over a real transport.
15
15
16
16
| # | Example | What it shows | Key API |
@@ -41,6 +41,6 @@ over a real transport.
41
41
| 23 |[`lifespan`](23-lifespan/)| Startup and shutdown hooks, run through the moonasgi lifespan core so the order is visible without a server |`App::on_startup`, `App::on_shutdown`, `App::lifespan_handler`|
42
42
43
43
The document `openapi_json(version=OpenApi31)` prints is the same one a server
44
-
([`mooncat`](https://github.com/Lfan-ke/mooncat)) serves at `/openapi.json`
44
+
([`mooncat`](https://github.com/moonbitstack/mooncat)) serves at `/openapi.json`
45
45
after `App::to_asgi`; swap `OpenApi31` for `OpenApi30` or `Swagger20` to emit the
0 commit comments