vors
vors3y ago

I m trying to curl my http endpoint

I'm trying to curl my http endpoint, getting
This Convex deployment does not have HTTP endpoints enabled.%
This Convex deployment does not have HTTP endpoints enabled.%
22 Replies
vors
vorsOP3y ago
I can DM the deployment name
ballingt
ballingt3y ago
yeah let's take a look solved
vors
vorsOP3y ago
Thank you!
jamwt
jamwt3y ago
@ballingt @vors what was the fix here? another dev is running into this @OccultSlolem is running into it
ballingt
ballingt3y ago
This was a dev/prod issue @OccultSlolem there are two different deployments with different urls, and there are two different subdomains for each of these
vors
vorsOP3y ago
I think there was also oh switch path: "/api/get-image", to pathPrefix: "/api/get-image",
ballingt
ballingt3y ago
you need to use a URL that looks like http://happy-otter-123.convex.site and the happy-otter-123 part needs to match the name of the deployment
OccultSlolem
OccultSlolem3y ago
I tried that I did both the convex.cloud and convex.site ends and i got a 404 on the first one and the endpoint not enabled error on the second
OccultSlolem
OccultSlolem3y ago
No description
OccultSlolem
OccultSlolem3y ago
in any case, im not seeing the functions on the dash
import { httpRouter } from 'convex/server';
import { httpEndpoint } from './_generated/server';

const http = httpRouter();

const promptModel = httpEndpoint(async ({}, request) => {
const { body } = await request.json();
console.log(body);
return new Response('Hello, World!', {
headers: {
'content-type': 'text/plain',
},
status: 200,
});
});

http.route({
path: '/promptModel',
method: 'POST',
handler: promptModel,
});

export default http;
import { httpRouter } from 'convex/server';
import { httpEndpoint } from './_generated/server';

const http = httpRouter();

const promptModel = httpEndpoint(async ({}, request) => {
const { body } = await request.json();
console.log(body);
return new Response('Hello, World!', {
headers: {
'content-type': 'text/plain',
},
status: 200,
});
});

http.route({
path: '/promptModel',
method: 'POST',
handler: promptModel,
});

export default http;
I still need help on this issue if you guys are available.
vors
vorsOP3y ago
My wild guess would be that for the pros you need to run convex deploy
OccultSlolem
OccultSlolem3y ago
Tried that too
vors
vorsOP3y ago
That would probably get you to the 404. Oh I see.
OccultSlolem
OccultSlolem3y ago
I've tried it on both dev and prod
ballingt
ballingt3y ago
@OccultSlolem are you at TreeHacks? I'm in person here to chat
OccultSlolem
OccultSlolem3y ago
I'm grabbing some food rn. I'll be back there in a sec tho.
ballingt
ballingt3y ago
Cool, let me know!
OccultSlolem
OccultSlolem3y ago
Hey Tom, are you still around?
ballingt
ballingt3y ago
yeah! At the table by the Convex banner
jamwt
jamwt3y ago
You all figure this out? @ballingt
ballingt
ballingt3y ago
Made a note to make the requirement that the http file be called http.js explicit
jamwt
jamwt3y ago
Ah

Did you find this page helpful?