koajs / mock Goto Github PK
View Code? Open in Web Editor NEWSimple web page mock middleware
License: Other
Simple web page mock middleware
License: Other
A new way to set scene name instead of file name.
__name
exists, use it instead of file name.
Since node has modified the query object to use a null
prototype, instead of an empty object in previous versions. See nodejs/node/pull/6289. I'm getting TypeError: this.query.hasOwnProperty is not a function
on this line.
Will create a pull request.
if (!view) {
return this.body = data;
}
if (IS_JSON_RE.test(this.path)) {
return this.body = data;
}
就是有点疑问, 如果我需要mock的是一个 json, 那么我准备的 mock 数据理论上就不应该有 __view
. 那么直接在第一个判断就返回了.
如果我请求的 user.json
是一个页面, 那么就算我准备了一个__view
那么还是会渲染成 json.
那什么情况下, 我请求一个 json 的 mock, 我还会提供一个__view
呢?
Need to meet the conditions:
GET /user/profile.json
on /home?__scene=default
page, should try to read /user/profile.json/default.js
mock data file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.