mokia

一个通过编写代码构建假模型来生成假数据的开源工具,便于前端mock接口测试。支持TypeScript,模型可复用,集成方便。

Check out mokia on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

名称:mokia地址:https://github.com/varHarrie/mokia描述:通过编写代码方式构建`假模型`,用于生成`假数据`,便于前端mock接口测试,`假模型`可以很方便在不同接口中复用。特点:- 非常方便集成到现有项目- 支持TypeScript- 模型高度复用- 丰富的假数据生成器使用方法:1.安装npm install mokia --save-dev````javascriptimport { decorators, mock, PORT, ServerConfig } from 'mokia'class User { decorators.uuid() id: string decorators.fullName() name: string}const config: ServerConfig = { [PORT]: 3000, 'GET /users': () => { return { users: mock.array(User, 0, 5) } }, 'GET /users/:id': () => { return mock(User) }}export default config```2.配置scripts:```json"scripts": { "mock": "mokia mock.ts",}```3.运行```bashnpm run mock```4.浏览器打开http://localhost:3000/users/5`,返回json:```json{ "id": "4fvke82k", "name": "张三"}```

Latest Weekly Picks

make.ink favicon
Weekly Pick

Your AI tattoo generator for pro-grade concepts

Leo Wade
sellfy.com favicon
Weekly Pick

A code-free online store builder to turn views into revenue. Sell digital products, subscriptions, and merch, without fees or hassle.

Maris
www.videotoblog.ai favicon
Weekly Pick

Convert videos into awesome blog posts.

Video To Blog
www.sellerpic.ai favicon
Weekly Pick

SellerPic is the all-in-one AI design platform for e-commerce

SellerPic
fastimage.ai favicon
Weekly Pick

Fast Image AI instantly transforms your photos into stunning styles like Ghibli, Sketch, and Pixar. Effortlessly control image elements and create amazing effects with just one click.

Fast AI Team
linkedinpro.daisy.so favicon
Weekly Pick

AI-powered tool that transforms casual photos into professional LinkedIn headshots instantly. No photographer needed—just upload and download.

Gabriel
crevas.ai favicon
Weekly Pick

Crevas unifies Veo 3, Sora 2, Nano Banana and more into one intuitive canvas — so filmmakers can script, prompt, and generate cinematic stories without switching tools or losing consistency.

Spark Alpha
fotominiatur.com favicon
Weekly Pick

AI Foto Edit - Text to Image & Image Edit

foto miniatur