Comments (4)
Hi @hartzis, I'm glad that you have found talkback this useful.
I really liked your idea of exposing the request handler API.
I just released a new version 2.2.0 which includes this feature.
https://github.com/ijpiantanida/talkback#talkbackrequesthandleroptions-partialoptions-promiserequesthandler
(I think I'm reaching the limits of what one README can handle 😄 ).
I've also included an example using puppeteer
https://github.com/ijpiantanida/talkback/blob/master/examples/request-handler/start.js
from talkback.
📓 In the process of exploring and vetting the above ideas and thoughts I stumbled across something very similiar useing pollyJS.
from talkback.
For the middleware idea, I'm not sure if I'm understanding it correctly.
If we're talking about intercepting request coming to /api/*
and returning a saved response when they exist, or continuing the middleware chain if not, then I'm not sure it's something that I'd like to implement.
I see how it can be convenient, but I don't like the idea of messing with the server's actual behavior. For now, I'm trying to keep talkback as an outside layer.
Now, if we're talking about providing a middleware just to mount Talkback without opening a new port, then that's something that can easily be implemented with the new request handler API
Feel free to open a new issue where we can discuss this further if I'm missing the point.
Thank you for these great ideas!
from talkback.
@ijpiantanida Wow, thank you, this is amazing! Even including an example with puppeteer!
The length of the readme is nothing btw, check out nock's readme, 1600 lines lol. I personally like a detailed readme. It can be nice to have all the details in one place.
I think more about the "middleware" idea, but i think a lot can be done with the new requestHandler
api.
Again thank you!
from talkback.
Related Issues (20)
- Error when trying to connect to an https with self-signed certificate HOT 1
- Key order matters when comparing requests HOT 3
- It would be great for Talkback to gain an optional mode of operation that's compatible with Servirtium
- Match headers HOT 1
- Multiple hosts support? HOT 7
- Requests fail on Node v15.2.1 HOT 4
- Question: Can users add arbitrary properties to `meta`? HOT 2
- How to stop the server on CI? HOT 4
- Talkback could set a way to enforce req and res as humanReadable at options HOT 5
- Potential Feature Request: Consider only specific headers? HOT 2
- Disable header matching or provide a matcher HOT 1
- When starting multiple servers the logging does not use the server name provided in options HOT 2
- How to decode the body in request part of the tape? HOT 3
- TapeMatchers doesn't consider difference in protocol HOT 5
- Logo for talkback HOT 1
- bug: tapes aren't recorded with human readable body HOT 6
- ng-talkback vs talkback HOT 2
- Preserving the order of requests for each tests HOT 1
- Numbering can cause errors if previous tape was deleted HOT 2
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 talkback.