mirror of
https://github.com/bartvdbraak/hellob.art.git
synced 2025-06-28 07:19:09 +00:00
fix: temp remove try-catch for log purposes
This commit is contained in:
parent
1d7f8878da
commit
b4bf22ea84
1 changed files with 52 additions and 52 deletions
|
@ -11,19 +11,19 @@ const height = 630;
|
||||||
const width = 1200;
|
const width = 1200;
|
||||||
|
|
||||||
const getImageData = async () => {
|
const getImageData = async () => {
|
||||||
try {
|
// try {
|
||||||
const imagePath = path.join(process.cwd(), 'src', 'lib', 'assets', 'og', 'me.jpg');
|
const imagePath = path.join(process.cwd(), 'src', 'lib', 'assets', 'og', 'me.jpg');
|
||||||
const meImage = await readFile(imagePath);
|
const meImage = await readFile(imagePath);
|
||||||
return Buffer.from(meImage).toString('base64');
|
return Buffer.from(meImage).toString('base64');
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.error('Error reading image:', error);
|
// console.error('Error reading image:', error);
|
||||||
throw error;
|
// throw error;
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @type {import('./$types').RequestHandler} */
|
/** @type {import('./$types').RequestHandler} */
|
||||||
export const GET = async ({ url }) => {
|
export const GET = async ({ url }) => {
|
||||||
try {
|
// try {
|
||||||
const title = url.searchParams.get('title') ?? undefined;
|
const title = url.searchParams.get('title') ?? undefined;
|
||||||
const subTitle = url.searchParams.get('subTitle') ?? undefined;
|
const subTitle = url.searchParams.get('subTitle') ?? undefined;
|
||||||
|
|
||||||
|
@ -64,13 +64,13 @@ export const GET = async ({ url }) => {
|
||||||
'content-type': 'image/png'
|
'content-type': 'image/png'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.error('Error generating image:', error);
|
// console.error('Error generating image:', error);
|
||||||
return new Response('Internal Server Error', {
|
// return new Response('Internal Server Error', {
|
||||||
status: 500,
|
// status: 500,
|
||||||
headers: {
|
// headers: {
|
||||||
'content-type': 'text/plain'
|
// 'content-type': 'text/plain'
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue