#how to deploy only convex backend without any frontend, i.e., vercel, netlify?
4 messages · Page 1 of 1 (latest)
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:
-
First, make sure you have set up your Convex project correctly with a
convexfolder containing your backend code, including yourhttp.tsfile. -
Set the
CONVEX_DEPLOY_KEYenvironment variable. You can get this key from your Convex dashboard under Settings > URL and Deploy Key. This key is used to authenticate your deployment. -
Run the following command in your terminal:
npx convex deployThis 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:
-
Make sure your
http.tsfile is correctly set up. It should export an instance ofHttpRouter. 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; -
After making changes to your
http.tsfile, make sure to deploy your changes usingnpx convex deploy. -
Check the Functions view in your Convex dashboard to ensure that your HTTP actions are listed there.
-
If you're still having issues, you can follow the debugging steps outlined in the Debugging HTTP Actions documentation.
If you continue to face issues, you may want to check your Convex dashboard for any error messages or logs that could provide more information about why the HTTP actions are not enabled.