You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Code is pretty much following the documentation of mswjs/data, but unfortunately the calls always result in a 500. Can anyone tell me where the problem is?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to use mswjs/data and especially the toHandlers-function to simply create an API for testing purposes.
service.ts
toHandlers is supposed to create CRUD-methods for the user-object.
I created a simple React-project using axios for consuming the API:
index.tsx
App.tsx
The Code is pretty much following the documentation of mswjs/data, but unfortunately the calls always result in a 500. Can anyone tell me where the problem is?
I published this little test-project on github:
https://github.com/DerRick79/mswjs-data-test
I manually created a users-method to get all users like this instead of the toHandlers-function:
This worked fine, so I don't see a problem with axios here.
Beta Was this translation helpful? Give feedback.
All reactions