#how to deploy only convex backend without any frontend, i.e., vercel, netlify?

4 messages · Page 1 of 1 (latest)

obsidian delta
#

how to deploy only convex backend without any frontend, i.e., vercel, netlify? im getting This Convex deployment does not have HTTP actions enabled. for my app that only has a http.ts convex backend and no frontend

wicked orioleBOT
#

Hi @obsidian delta. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To deploy only the Convex backend without a frontend, you can use the npx convex deploy command. This command will deploy your Convex functions to your production deployment. Here's how to do it:

  1. First, make sure you have set up your Convex project correctly with a convex folder containing your backend code, including your http.ts file.

  2. Set the CONVEX_DEPLOY_KEY environment variable. You can get this key from your Convex dashboard under Settings > URL and Deploy Key. This key is used to authenticate your deployment.

  3. Run the following command in your terminal:

    npx convex deploy
    

    This command will deploy your Convex functions to your production deployment without needing any frontend hosting like Vercel or Netlify.

Regarding the error message "This Convex deployment does not have HTTP actions enabled," this could be due to a few reasons:

  1. Make sure your http.ts file is correctly set up. It should export an instance of HttpRouter. Here's an example:

    import { httpRouter } from "convex/server";
    
    const http = httpRouter();
    
    http.route({
      path: "/your-path",
      method: "POST",
      handler: async (ctx, request) => {
        // Your handler logic here
      },
    });
    
    export default http;
    
  2. After making changes to your http.ts file, make sure to deploy your changes using npx convex deploy.

  3. Check the Functions view in your Convex dashboard to ensure that your HTTP actions are listed there.

  4. If you're still having issues, you can follow the debugging steps outlined in the Debugging HTTP Actions documentation.