File-based mock toolkit for Vite, CLI builds, and runtime usage.
Website · Playground · GitHub
- 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.
Create mock/users.get.json:
{ "ok": true }Create mock/login.post.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:
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.
Issues and pull requests are welcome. See CONTRIBUTING.md.
Thanks to all contributors!
ice breaker 1324318532@qq.com
Distributed under the MIT License. See LICENSE for more information.