APIs
Remix routes have the ability to handle both backend code and UI code in the same file. Remix loader
s and action
s are backend code that's tightly coupled to the UI code for that route.
Resource Routes
You can define routes that don't have any UI at all. These are called resource routes. This allows you to:
- Create REST endpoints
- Create GraphQL endpoints
- Make your app data and logic consumable by third parties
- Support additional clients (like mobile apps)
- Generate PDFs
- Process and serve images
- Stream multi-media content
- And much more
Full Stack Components
The stack includes several resource routes for:
- Managing images and file uploads
- Cache management and control
- Full stack components that handle both frontend UI and backend logic in a cohesive way
These resource routes are designed to be both secure and performant, following REST best practices while leveraging Remix's powerful routing system.
Third Party Integration
The API system is designed to be easily consumable by third party clients. Whether you're building:
- Mobile applications
- External integrations
- Microservices
- Partner API access
The resource routes provide a clean, RESTful interface for accessing your application's data and functionality.
Best Practices
When creating APIs using resource routes:
- Keep routes focused on a single responsibility
- Use appropriate HTTP methods for different operations
- Implement proper error handling
- Add authentication where needed
- Consider rate limiting for public endpoints
- Document your endpoints thoroughly
For more information on security considerations, check out the security documentation.