Giter Club home page Giter Club logo

Comments (4)

ijpiantanida avatar ijpiantanida commented on June 19, 2024 1

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.

hartzis avatar hartzis commented on June 19, 2024

📓 In the process of exploring and vetting the above ideas and thoughts I stumbled across something very similiar useing pollyJS.

from talkback.

ijpiantanida avatar ijpiantanida commented on June 19, 2024

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.

hartzis avatar hartzis commented on June 19, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.