In this lecture, we are going to talk about how we can actually intercept a network in terms of our
particular data.
If you have on an API and we want to show that particular data, it's more like a mocking data that
we can do for our network request.
So Muqdadiyah kind of very, very famous, where you can actually intercept a real network and you can
create your own injector data, which you can use like a mark and stub and stuff.
I mean, I'm not going to go into that deep level of markings and STUBING, but what I'm trying to do
right now is going to be applicable for mocking and disturbing as well.
So what are going to do is we are going to make use of a fake Jasen server, which is going to have
like a small API server running.
And that particular observer is actually going to be responsible for performing such an action for us.
So if I just go to the Google Chrome, probably and if I search for fake, um, Jasen server, you can
see that there is something called us type called fakirs on server.
So this is going to be like a full jasen server, which is going to be like a fake, by the way, which
you can use for building your JS on servers and stuff.
The installation of the figures on server is super easy.
All you got to do is you're going to do this npm install hyphen G Artisan's over.
That's it.
If you do that, you will have a jasen server for you and then you can create a DVD on file with the
supposed commands and stuff.
And if you run the speaker JS So we're using this particular command like Jayson's over hyphenation.
Watch our DVR, John, and you can access this server using this particular you are URL and the port
and stuff.
This is super easy.
So what I'm going to do is I'm going to go to our study
Udemy Playwrite Section six over here, and then I'm just going to do a code maybe an hour that I'm
going to call this as data.
And within this data, I'm just going to go to the state.
I probably am going to create a file.
I'm going to call this as probably debate autism.
And this debate or design is going to hold this data, which as you can see or hear.
So I'm just going to copy paste the same data, probably.
But you can change whatever data that you really like and you can access the data from the part that
you're going to be specifying just for the sake of time and just for the simplicity as well.
I'm just going to go with whatever is there already.
Right?
So I'm just going to stay with this one.
And now if I just go here and if I just go to the JS on server hyphen, hyphen Waj of Dot, I mean probably
deep down Jasen.
And if I had run, you can see that the data on server is currently up and running.
So this is the super simple command that you can do to run a super simple design server.
So if I tried to access this station server, just consider this, this is going to be a real jasen
server which is running, but you need to intercept this particular network request.
Yeah.
So I'm going to see that this network request is currently running.
And if I try to access the post, you can see that the network request post is coming pretty quickly.
And this is the data on server title and authoress type of code, something like that.
This is all coming from this place, by the way.
So if I just change the title to probably playwright and author is going to be like Katic if I save
this and if I try to access this, you can see the title Playwrite and other discothèque coming in so
instantly because it is setting the database the way basically from this particular JS on file.
That's it.
That simple.
It is.
And now we need to intercept this particular network request and we need to see how we can actually
do that using playwrite.