-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/TEAM-BEAT/BEAT-Client in…
…to feat/#338/CarouselSlide
- Loading branch information
Showing
34 changed files
with
434 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export async function GET(request) { | ||
console.log("hi im test"); | ||
|
||
return new Response(JSON.stringify({ message: "Hi from the server!" }), { | ||
status: 200, | ||
headers: { "Content-Type": "application/json" }, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Prerenderer from "@prerenderer/prerenderer"; | ||
import PuppeteerRenderer from "@prerenderer/renderer-puppeteer"; | ||
import chromium from "@sparticuz/chromium-min"; | ||
|
||
export async function POST(req: Request, res) { | ||
console.log("req is: ", req); | ||
|
||
try { | ||
const body = await readBody(req); | ||
|
||
const { performanceId } = body; | ||
console.log("performanceId is: ", performanceId); | ||
|
||
const chromePath = | ||
process.env.VITE_CHROME_PATH || | ||
(await chromium.executablePath( | ||
"https://github.com/Sparticuz/chromium/releases/download/v121.0.0/chromium-v121.0.0-pack.tar" | ||
)); | ||
|
||
// 프리렌더 작업 수행 | ||
const prerenderer = new Prerenderer({ | ||
staticDir: __dirname, // 정적 파일이 있는 디렉터리 경로 | ||
renderer: new PuppeteerRenderer({ | ||
launchOptions: { | ||
args: ["--no-sandbox", "--disable-setuid-sandbox"], | ||
ignoreDefaultArgs: ["--disable-extensions"], | ||
defaultViewport: chromium.defaultViewport, | ||
executablePath: chromePath, | ||
ignoreHTTPSErrors: true, | ||
headless: chromium.headless, | ||
}, | ||
maxConcurrentRoutes: 1, | ||
renderAfterTime: 500, | ||
}), | ||
}); | ||
|
||
await prerenderer.initialize(); | ||
await prerenderer.renderRoutes([`/gig/${performanceId}`]); | ||
await prerenderer.destroy(); | ||
|
||
res.status(200).json({ message: "Prerender complete", performanceId }); | ||
} catch (error) { | ||
console.error("Error during prerendering:", error); | ||
res.status(500).json({ message: "Error during prerendering", error }); | ||
} | ||
} | ||
|
||
// Request body를 JSON으로 파싱하는 유틸리티 함수 | ||
async function readBody(req) { | ||
const chunks = []; | ||
for await (const chunk of req) { | ||
chunks.push(chunk); | ||
} | ||
const buffer = Buffer.concat(chunks).toString(); | ||
return JSON.parse(buffer); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export async function GET(request) { | ||
console.log("hello im test"); | ||
|
||
return new Response(JSON.stringify({ message: "Hello from the server!" }), { | ||
status: 200, | ||
headers: { "Content-Type": "application/json" }, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from "react"; | ||
import type { SVGProps } from "react"; | ||
const SvgNotFoundAsset = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 150 109" {...props}> | ||
<path | ||
fill="url(#not_found_asset_svg__a)" | ||
d="m60.984 58.346-12.13-38.629L42.907 0l-5.799 19.998-14.514 57.484-8.474-19.136H-10V69.25H7.975l9.403 21.365L26.25 109l5.467-20.355 11.975-45.206 8.102 25.81H166V58.347z" | ||
/> | ||
<defs> | ||
<linearGradient | ||
id="not_found_asset_svg__a" | ||
x1={78} | ||
x2={78} | ||
y1={0} | ||
y2={109} | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<stop stopColor="#FF006B" /> | ||
<stop offset={1} stopColor="#252525" /> | ||
</linearGradient> | ||
</defs> | ||
</svg> | ||
); | ||
export default SvgNotFoundAsset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.