A modern CORS proxy API and API testing tool built with Next.js and TypeScript.
Trevo is an open-source API proxy and testing tool designed to bypass CORS restrictions and make interacting with APIs seamless. It acts as an intermediary between your frontend application and external APIs, handling all HTTP methods including GET, POST, PUT, PATCH, and DELETE with proper request body forwarding.
- CORS Proxy: Bypass Cross-Origin Resource Sharing restrictions when making API requests
- Support for All HTTP Methods: Handles GET, POST, PUT, PATCH, and DELETE requests
- Request Body Forwarding: Properly forwards request bodies for all methods
- Content Type Support: Handles JSON, form data, and plain text request bodies
- Testing Interface: Built-in UI for testing API requests
- Response Inspection: View detailed response information including headers, status, and body
- SEO Optimized: Includes metadata, structured data, sitemap, robots.txt, and manifest for better search engine visibility
- API Documentation: Comprehensive documentation for the API endpoints
- PWA Ready: Progressive Web App support with manifest and icons
- Node.js (v18 or higher)
- npm or yarn
- Git
- Clone the repository:
git clone https://github.com/olucasandrade/trevo.git
cd trevo- Install dependencies:
npm install
# or
yarn install- Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000/test to access the API testing interface. Visit http://localhost:3000/api to view the API documentation.
To use the CORS proxy, make requests to:
http://localhost:3000/api?url=YOUR_TARGET_URL
Example:
// Making a POST request through the proxy
fetch('http://localhost:3000/api?url=https://api.example.com/data', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ key: 'value' })
})
.then(response => response.json())
.then(data => console.log(data));The built-in testing interface at /test allows you to:
- Select HTTP methods (GET, POST, PUT, PATCH, DELETE)
- Enter target URLs
- Choose body types (JSON, Form URL Encoded, Plain Text)
- Send requests and view detailed responses
- Toggle body inclusion for DELETE requests
Trevo includes several SEO optimizations:
- Metadata: Comprehensive metadata for all pages
- Open Graph: Social media sharing metadata
- Structured Data: JSON-LD structured data for better search engine understanding
- Sitemap: Automatically generated sitemap.xml
- Robots.txt: Properly configured robots.txt file
- Web App Manifest: PWA support with manifest.json
- Semantic HTML: Proper HTML structure with semantic elements
- API Documentation: SEO-friendly documentation page
trevo/
├── src/
│ ├── app/
│ │ ├── api/ # CORS proxy API implementation and documentation
│ │ ├── services/ # API service utilities
│ │ ├── test/ # Testing interface
│ │ ├── sitemap.ts # Sitemap generator
│ │ ├── robots.ts # Robots.txt generator
│ │ └── manifest.ts # Web app manifest generator
│ └── components/ # Reusable components
├── public/
│ └── seo/ # SEO-related assets and icons
You can easily integrate Trevo with your existing applications:
- Deploy Trevo to your preferred hosting platform
- Use the API endpoint in your frontend applications to bypass CORS restrictions
- Link to the testing interface for your team to debug API requests
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have questions or need help, please:
- Open an issue
- Reach out to the maintainers