Comments (2)
That's a good point. I don't think it needs to have its own option setting since you can access the request object in a custom filename generator. I wasn't able to simply create a custom filename generator for the hashFullRequest
feature because I couldn't access the request body when the filename generator is called (once a response is returned). I could add another filename generator in the next release, or you could implement it yourself with the mockFilenameGenerator
feature.
from connect-prism.
Thanks for the suggestion. I came up with this naive implementation:
var crypto = require('crypto');
function customMockFilename(config, req) {
var reqData = req.method + ' ' + req.url;
var shasum = crypto.createHash('sha1');
shasum.update(reqData);
return shasum.digest('hex') + '.json';
}
from connect-prism.
Related Issues (20)
- MockRecord mode doesn't work with hashFullRequest
- Extra mock files created using humanReadable + ignoreParameters HOT 1
- Conflict with grunt-sass HOT 2
- Grunt is a full dependency, not a devDependency HOT 1
- Wrong dependency for di selected HOT 3
- grunt should be a dev dependency
- Grunt peerDependency, why? HOT 1
- Mock file names can get so long that they break Windows HOT 1
- connect-prism doesn't use existing mocks HOT 2
- proxy is removing content-length from header HOT 1
- useapi() doesn't work after creating a prism server with the POST /_prism/create method HOT 10
- Image record do not work HOT 1
- Am i misusing connect-prism? Can it do proxying and recording for real 3rd party APIs? HOT 4
- TypeError on POST in v.1.0.11/12 HOT 3
- [question] Is it possible to remove dependency on di? HOT 6
- mock response file for request with query params HOT 2
- ignoreParameters let prism crash on windows HOT 1
- shouldRecord does not allow checking of response body
- Mix with dynamic data HOT 1
- Sometimes no mock created when part of the url start with digits
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect-prism.