I'm brand new to Pages, I need some help (probably easy)

I used to run my NON-static node.js site through Azure, and I got sick of their services always being slow or stupid. I just linked my Github Repository to the "Pages" site I made, but it doesn't run the actual functionality of my site, which is in build settings works if I build the site with no build command, then if I cancel the build and add node . in the build command it runs, however, I do not have time to jump between websites to update my site. I want it to just go "okay yep finished building, now I will run node . and wait until I hear from Github again until I redeploy it. I'm 100% unsure of how Workers work, I just cannot be assed learning new languages just to run a site that simply has HTML, CSS, JS (node) that just has a server that requests from an xml data site.
9 Replies
trainguy
trainguyOP6mo ago
Also just realised there is a help section for Pages.
Hard@Work
Hard@Work6mo ago
Not sure I understand? If you are asking whether Pages can run your Node server for you, that is a no.
Flare
Flare6mo ago
Cloudflare Pages is for static content (HTML, CSS, JS, images and other such files). It will not run a webserver such as Express, Koa or the likes. If you're using those to serve static content then you can just remove that part and use Pages! If you're doing more dynamic content you can use Functions. It will run code on request (so still not a webserver in the conventional sense). This would allow for more dynamic content though especially with KV (Key/Value storage) and Durable Objects (transactional data storage). Functions are natively integrated with Pages so are super easy to get up and running along your website. Otherwise, a good old VPS or dedicated server from one of the many hosts out there is for you.
Hard@Work
Hard@Work6mo ago
Or at least not without some rewriting(which from your message I assume you don't want to do)
trainguy
trainguyOP6mo ago
There are buzzwords I haven't heard of before, such as KV and DO, I understand Pages is static, but I have different documentation pages colliding with information that makes no sense, as yes, I use express to run my node server. Thanks for your help, I will look into Functions as I havent found that yet and let you know the outcome.
Hard@Work
Hard@Work6mo ago
Basically, static stuff "just works". For stuff where you need a server, (like Node's Express), you need to do some rewriting to make it work on Pages
trainguy
trainguyOP6mo ago
Is it mainly just Cloudflare setup or genuine rewriting, for instance, in my github
Hard@Work
Hard@Work6mo ago
Most of it is making changes to your code
trainguy
trainguyOP6mo ago
Like my server basically gets the information from a site, then changes it all into web-readable code, then each page takes the web-readable code from an endpoint that the server hosts it from I'm doing reading on this Functions thing and it looks as if I have to recode almost everything
Want results from more Discord servers?
Add your server