Can Pages and Workers be combined?

Hello everyone,

I am using Pages for my Hugo blog. I’m currently testing a small Worker to include comments in my blogposts.
But I am quite confused on how to include and deploy the Worker within my Hugo repository. Can I simply push to github and my Hugo site and Worker gets deployed from there or is that not possibly? Or does the Hugo site also need to be deployed through Workers? So Pages and Workers can’t be used together?

Would be really nice if someone cloud help me clear things up.

Thanks in advance! :slight_smile:

You might be interested in the new announcements from Full Stack Week.

https://developers.cloudflare.com/pages/platform/functions

A couple beta notes:

  1. Functions are free, for now (they expect billing similar to Workers, but nothing is finalised) up to 100k reqs/day, you can ask them to increase the limit (read the blog post and docs above).
  2. Deploying APIs to specific paths will cause all requests hitting functions, even if outside the scoped path. They might remove this behaviour and scope correctly.
    If you want to scope correctly deploy Workers separately via GitHub actions, but it requires more work.
1 Like