← All guides

Bolt API rescue

Bolt.new API routes work in preview but fail in production

Bolt.newVPSSupabase

Short answer

API routes working correctly on the production server with proper routing and environment.

Why this matters

The frontend loads but every API call returns 500 or 404 because the server cannot route or execute the API functions.

Walkthrough

  1. 01

    Identify the API framework

    Bolt.new may use different API patterns depending on the app stack.

    • Check if the app uses Next.js API routes, Express, Hono, or another framework.
    • Find the server entry point and understand the routing setup.
    • List all API endpoints and their expected request/response shapes.
  2. 02

    Configure the server runtime

    The server needs the right runtime to execute API routes.

    • Install all dependencies including server-side packages.
    • Set the correct start command that launches both frontend and API routes.
    • Load environment variables from the server, not from local files.
  3. 03

    Test every API endpoint

    Verify each API route responds correctly before going live.

    • Test each endpoint with curl or Postman using the production URL.
    • Check server logs for errors on each request.
    • Verify database connections, auth checks, and external API calls work.

Where RepoAssistant fits

RepoAssistant diagnoses and fixes Bolt.new API routes during production deployment.