Skip to content

What is an API route?

An API route is a file in your web app that runs on the server and answers requests at one address. Code that uses a secret key belongs there, not in the browser.

An example

Your contact page has a Send button. It calls an API route at /api/send, which reads the email key from your .env file on the server and sends the email.