I have a fake server created with mirajeJs. All my requests are trying to contact him, how can I make a request for mirajeJs only in cases when I need it while making the rest of the requests to the real server
Asked
Active
Viewed 164 times
3
-
Do you need to access MirageJS and real API at the same time? Otherwise, you can create an environment variable. – Patrick Apr 26 '21 at 16:16
-
yes I wanna use at the same time miraje js for requests that is not implemented now and my backend, I dont know how env variales can help me, please give advise bellow – ask_question_alex alex Apr 26 '21 at 16:18
1 Answers
2
You can use a passthrough:
createServer({
routes() {
// Allow unhandled requests on the current domain to pass through
this.passthrough()
},
})

Bassem
- 3,582
- 2
- 24
- 47