Handers
The src/handlers/ folder is a critical part of the NoApi architecture, responsible for managing communication between the frontend and backend. This folder contains auto-generated code that ensures seamless interaction between your Rust backend functions and the TypeScript frontend. Importantly, this folder should not be modified manually by the user.
- Every time you make changes to the src/functions.rs file, NoApi automatically regenerates the contents of the src/handlers/ folder. This ensures that the handlers stay in sync with your backend logic and TypeScript types. If you manually edit files in this folder, your changes will be overwritten during the next regeneration, or worse, they could introduce errors that break your application.
The handlers act as a bridge, translating requests from the frontend into calls to your Rust functions and vice versa. They also handle type conversions between Rust and TypeScript, ensuring that data is correctly passed between the two layers.