VercelGL is a simple, lightweight API to use serverless chrome. It is designed to be used with the Vercel platform, but can be used anywhere.
currently there is only one route implemented
POST /api/screenshot
Body
Bear in mind that this app is more like template so fill free to bend for your use case (mine is looking for
<canvas>
the web)
{
"url": "https://bafybeigsw7gagsmvxxivt5kvrl6ueld7yszzef2aylxbzzafez6ybxscca.ipfs.nftstorage.link"
}
![Screenshot 2024-01-22 at 11 56 56](https://private-user-images.githubusercontent.com/22471030/298554037-58f382b1-fb09-445b-a519-abdaad1b50ff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MTIxNzEsIm5iZiI6MTcyNDcxMTg3MSwicGF0aCI6Ii8yMjQ3MTAzMC8yOTg1NTQwMzctNThmMzgyYjEtZmIwOS00NDViLWE1MTktYWJkYWFkMWI1MGZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI2VDIyMzc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ4NDA3ZjViZGJhNTQ2NTljNjg2OWU2M2Q4ZDI2MGRjMGE0M2UzNTkzZDY3YmQ0NGMwNDAxNTVkYmQ4ODJjMGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.BoEOpW0NqgX1v3RJAgliLlF7WLHPXUypxgPCPtrdEJ0)
Seems that many users have problem with paths etc. Using pnpm as package manager seemed to make a difference.
Please increase maxDuration
for the serverless functions in vercel.json
:
"functions": {
"api/**/*": {
"maxDuration": 60
}
}
https://gist.github.com/kettanaito/56861aff96e6debc575d522dd03e5725