Initial commit with 🏗️ Scaffold-ETH 2 @ 1.0.5
This commit is contained in:
12
packages/nextjs/app/api/ipfs/get-metadata/route.ts
Normal file
12
packages/nextjs/app/api/ipfs/get-metadata/route.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { getNFTMetadataFromIPFS } from "~~/utils/tokenization/ipfs";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const { ipfsHash } = await request.json();
|
||||
const res = await getNFTMetadataFromIPFS(ipfsHash);
|
||||
return Response.json(res);
|
||||
} catch (error) {
|
||||
console.log("Error getting metadata from ipfs", error);
|
||||
return Response.json({ error: "Error getting metadata from ipfs" });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user