Lune
CDCloudflare Developers
•Created by Lune on 10/4/2024 in #workers-help
Puppeeter with cloudflare workers
Hello! I recently saw this github repo : https://github.com/cloudflare/puppeteer
I have a SvelteKit project hosted on Cloudflare Pages and I would like to add an invoice system. I'm not very talented with PDFs, so I want to create PDF from HTML code. The only way I found was to use Puppeteer to render an html page and save it as PDF.
I did all my pdf tests in a separate project, and now that I feel more comfortable with puppeteer, I want to include it to my SvelteKit project.
I still have issues in understanding the difference between Workers and Pages, but from what I read Pages is meant for static websites, therefore there's no nodejs environment for puppeteer to run on. So my question is: Does cloudflare/puppeteer is meant to be use in workers ? If yes, can I include it in my sveltekit app and host the project in workers rather than pages ?
Have a nice day!
4 replies
CDCloudflare Developers
•Created by Lune on 9/21/2024 in #general-help
Is free plan really free ?
Hello ! It's the first time I'm going to lead a deployment, I never deployed anything that wasn't a hobby project. I want to try Cloudflare Pages for a SvelteKit app.
A friend of mine told me that SvelteKit is great with cloudflare pages because even though CloudFlare Pages is mainly used for static sites there's a feature called "function" that can be used for server requests. In sveltekit .js files can be renamed as .server.js to tell the framework that the code inside the file is meant to be ran in the server only.
I deployed the site and it works well, but I'm a bit confused about CloudFlare's plans. I thought that CloudFlare was able to offer a free hosting because it was a static site hosting (without server) but what about functions then ? Are they paid ? Am I going to be charged even though my account is set to the free tier ? I'm a student and I think I went ahead of myself by deploying without reading the pricings enough and now I fear to not being able to pay :/
7 replies