https://github.com/oboard/mocket
A web framework for MoonBit.
https://github.com/oboard/mocket
http moonbit server
Last synced: 4 days ago
JSON representation
A web framework for MoonBit.
- Host: GitHub
- URL: https://github.com/oboard/mocket
- Owner: oboard
- License: apache-2.0
- Created: 2024-07-31T07:34:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-22T13:02:32.000Z (11 days ago)
- Last Synced: 2026-01-23T05:22:13.654Z (10 days ago)
- Topics: http, moonbit, server
- Language: C
- Homepage: https://mocket.oboard.fun/
- Size: 1.52 MB
- Stars: 81
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome-moonbit - oboard/mocket
- awesome - oboard/mocket - A web framework for MoonBit. (<a name="MoonBit"></a>MoonBit)
README
# oboard/mocket
[](https://mooncakes.io/docs/oboard/mocket) [](https://github.com/oboard/mocket/actions/workflows/check.yaml) [](https://github.com/oboard/mocket/blob/main/LICENSE)
A web framework for MoonBit.
[👉 Documentation](https://mocket.oboard.fun/)
## Quick Start
```moonbit
fn main {
let app = @mocket.new()
app.get("/", _ => "Hello, Mocket!")
app.serve(port=4000)
}
```
Mocket supports both `js` and `native` backends.
### JavaScript Backend
Set the backend of MoonBit to `js` in `Visual Studio Code`
Command: `MoonBit: Select Backend` -> `js`
```bash
moon run src/example --target js
```
### Native Backend
Set the backend of MoonBit to `native` in `Visual Studio Code`
Command: `MoonBit: Select Backend` -> `native`
```bash
moon run src/example --target native
```
Then visit http://localhost:4000
## Usage
Minimum Example: https://github.com/oboard/mocket_example
## Q & A
### Why not moonbitlang/async ?
moonbitlang/async is a great library, but it is not supported by the js backend.
🙌快来吧!🙌
QQ 群号:**949886784**
