Preview Backend - Quick Start Guide
The preview server is a headless chromium instance that generates screenshots and animations of items via puppeteer. It's also in charge of generating unique trading cards for every NFT item minted. Here's how it works:
- User-agent (website or Discord bot) requests a preview image.
- Request gets sent to the preview server then checks S3 cache if there's a preview already.
- If there's no preview, the server will ask the API about the token and fetch the IPFS content.
- The files from the IPFS hash get rendered using Puppeteer then exported as previews.
(Optional): Before running the application make sure Ports :80, :8997, :8998, :8999 are not already in use. If your port :80 is in use, you can change it from index.js
# Change default port inside index.js
const PORT = parseInt(process.env.PORT, 10) || <3000 OR ANY_FREE_PORT>;
├─── index.js <--- Main Application Logic Resides Here