https://github.com/sonofmagic/mokup
Fast, composable mock tooling
https://github.com/sonofmagic/mokup
hono mock mock-server
Last synced: 4 months ago
JSON representation
Fast, composable mock tooling
- Host: GitHub
- URL: https://github.com/sonofmagic/mokup
- Owner: sonofmagic
- License: mit
- Created: 2026-01-15T12:22:57.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-02-06T15:18:13.000Z (4 months ago)
- Last Synced: 2026-02-06T23:56:39.621Z (4 months ago)
- Topics: hono, mock, mock-server
- Language: TypeScript
- Homepage: https://mokup.icebreaker.top/
- Size: 2.97 MB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
mokup
File-based mock toolkit for Vite, CLI builds, and runtime usage.
Website ·
Playground ·
GitHub
## Why mokup
- File-based routing via filename suffixes like `users.get.json`.
- JSON/JSONC and TS/JS handlers powered by Hono Context.
- Works in Vite dev, CLI builds (workers), and runtime adapters.
- Built-in headers, status, delays, and middleware hooks.
## Quick start
Create `mock/users.get.json`:
```json
{ "ok": true }
```
Create `mock/login.post.ts`:
```ts
export default async (c) => {
const body = await c.req.json().catch(() => ({}))
return { ok: true, user: body }
}
```
Tip: you can use `defineHandler` for better IntelliSense:
```ts
import { defineHandler } from 'mokup'
export default defineHandler(async (c) => {
const body = await c.req.json().catch(() => ({}))
return { ok: true, user: body }
})
```
Follow the docs at http://mokup.icebreaker.top/ for Vite and CLI setup.
## Contributing
Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
## Contributors
Thanks to [all contributors](https://github.com/sonofmagic/mokup/graphs/contributors)!
## Authors
ice breaker <1324318532@qq.com>
## License
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.