Skip to content

Commit

Permalink
try fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
guyutongxue committed Jan 22, 2025
1 parent 525ecc2 commit c9d8573
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/v2/deck_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ const X_CHARACTER_PADDING = Math.round(
(WIDTH - CHARACTER_WIDTH * 3 - GAP * 2) / 2,
);

const IMAGE_DIR = path.resolve(import.meta.dirname, "../../public/assets");
const IMAGE_DIR =
process.env.NODE_ENV === "production"
? ".vercel/output/static/assets"
: path.resolve(import.meta.dirname, "../../public/assets");

/**
*
Expand All @@ -40,6 +43,7 @@ const IMAGE_DIR = path.resolve(import.meta.dirname, "../../public/assets");
* @returns
*/
export default async function handler(req, res) {
const host = req.headers.host;
const { code } = req.query;
if (typeof code !== "string") {
res.status(400).send("Bad request (code)");
Expand Down

0 comments on commit c9d8573

Please sign in to comment.