For an API route to work, you need to export as default a function (a.k.a **request handler**), which then receives the following parameters:
-`req`: An instance of [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage), plus some pre-built middlewares you can see [here](/docs/api-routes/api-middlewares.md)
-`res`: An instance of [http.ServerResponse](https://nodejs.org/api/http.html#http_class_http_serverresponse), plus some helper functions you can see [here](/docs/api-routes/response-helpers.md)
To handle different HTTP methods in an API route, you can use `req.method` in your request handler, like so:
> API Routes [do not specify CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), meaning they are **same-origin only** by default. You can customize such behavior by wrapping the request handler with [micro-cors](/docs/api-routes/api-middlewares.md#micro-support).
> API Routes do not increase your client-side bundle size. They are server-side only bundles.
## Related
For more information on what to do next, we recommend the following sections:
<divclass="card">
<ahref="/docs/api-routes/api-middlewares.md">
<b>API Middlewares:</b>
<small>learn about the built-in middlewares for the request.</small>
</a>
</div>
<divclass="card">
<ahref="/docs/api-routes/response-helpers.md">
<b>Response Helpers:</b>
<small>learn about the built-in methods for the response.</small>