Blankeos
Blankeos
CCConvex Community
Created by Blankeos on 9/16/2023 in #support-community
Recommend way to serve files via an HTTP Stream
Is it possible to serve video files by streaming HTTP? Very similar to what this guy is doing in Node.js: https://youtu.be/ZjBLbXUuyWg?si=8-dICa2jrlXMSxrA
2 replies
CCConvex Community
Created by Blankeos on 9/14/2023 in #support-community
Is there a way to get the type of a schema?
Let's say I have a schema defined in schema.ts. Is it possible to use their types for my own custom functions or utilities?
4 replies
CCConvex Community
Created by Blankeos on 9/14/2023 in #support-community
await request.json() destructuring body?
// handler
export const registerHTTP = httpAction(async (ctx, request) => {
const { body } = await request.json();

console.log(`Sent via HTTP action: ${body}`);

return new Response(null, {
headers: new Headers({
'Content-Type': 'application/json'
})
});

fetch(url + '/test-api', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'test@gmail.com',
username: 'test',
})
}).then(async (res) => {
if (res.ok) {
const json = await res.json();
console.log(json);
}
{
console.log(res.statusText);
}
});
// handler
export const registerHTTP = httpAction(async (ctx, request) => {
const { body } = await request.json();

console.log(`Sent via HTTP action: ${body}`);

return new Response(null, {
headers: new Headers({
'Content-Type': 'application/json'
})
});

fetch(url + '/test-api', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'test@gmail.com',
username: 'test',
})
}).then(async (res) => {
if (res.ok) {
const json = await res.json();
console.log(json);
}
{
console.log(res.statusText);
}
});
I'm getting 200, but all I'm getting on the logs is:
log
'Sent via HTTP action: undefined'
log
'Sent via HTTP action: undefined'
6 replies
CCConvex Community
Created by Blankeos on 9/13/2023 in #support-community
Is there a way to check the headers in the context or pass it?
I made my own auth through convex and I need to access the cookie. I'm not using any of the auth providers. This is inside a mutation by the way.
2 replies