changed to simple response.
This commit is contained in:
parent
5beb36cf45
commit
c1ab62a44f
@ -4,12 +4,13 @@ interface Env {
|
|||||||
export const onRequest: PagesFunction<Env> = async (context) => {
|
export const onRequest: PagesFunction<Env> = async (context) => {
|
||||||
try {
|
try {
|
||||||
console.log('start');
|
console.log('start');
|
||||||
const res = await fetch('https://api.assemblyai.com/v2/realtime/token',
|
/* const res = await fetch('https://api.assemblyai.com/v2/realtime/token',
|
||||||
{method: 'POST', body: JSON.stringify({expires_in: 3600}), headers: {authorization: context.env.VOICE_TOKEN}});
|
{method: 'POST', body: JSON.stringify({expires_in: 3600}), headers: {authorization: context.env.VOICE_TOKEN}});
|
||||||
console.log(res);
|
|
||||||
const response = await res.json();
|
*/
|
||||||
console.log(res);
|
|
||||||
return Response.json(response);
|
|
||||||
|
return new Response("Hello World!", {status: 200});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return new Response(error.message, {status: 500});
|
return new Response(error.message, {status: 500});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user