Skip to content

Debug and test an endpoint

While developing your endpoint, you can test it locally to check if it works as expected.

Run locally

To run your endpoint locally, do the following:

  1. Run the following Netlify SDK command to start a local development server:

    pnpm run dev

    This provides you with a URL to access the local development server. For example, at http://localhost:8888.

  2. Test your endpoint by sending requests to /.netlify/functions/your-endpoint-name. If your server is at localhost:8888, then you can test it at http://localhost:8888/.netlify/functions/your-endpoint-name.

Debug

All console.log statements are output to the terminal where you ran the preview command. This is useful for debugging your endpoint.

Next steps

When you’re ready, you can publish your extension as a private extension and test it with a site in production.

Got it!

Your feedback helps us improve our docs.