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
Then in my backend package I have routes folder with a user router file in this format
import { zodiosRouter } from '@zodios/express';
import { userApi } from '@common/api/user';
import userController from '@backend/controllers/api/v1/userController';
const userRouter = zodiosRouter(userApi);
userRouter.get('/user', userController.getUser);
There is type safety on the router itself so If I was to modify the getUser function of the userController it would be highlighted but I would also like this to be on the controller functions too
There is no mention in the documentation about this or a module named zodiosRequest, zodiosResponse etc which would satisfy my needs. Is there a workaround using Zod and Typescript so that I can achieve the level of code splitting as scalability will be very important for this project
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 have set up a project to use zodios with express and react using pnpm workspaces
my folder structure is
-frontend -common -backend
In the common package an API definition for the user routes can be found
Then in my backend package I have routes folder with a user router file in this format
There is type safety on the router itself so If I was to modify the getUser function of the userController it would be highlighted but I would also like this to be on the controller functions too
Instead of
There is no mention in the documentation about this or a module named zodiosRequest, zodiosResponse etc which would satisfy my needs. Is there a workaround using Zod and Typescript so that I can achieve the level of code splitting as scalability will be very important for this project
Beta Was this translation helpful? Give feedback.
All reactions