Yes - this is the most often used application of Workers. And the reason JS (note that Workers do not run node - it’s effectively vanilla JS) was chosen is so that it scales with the scale CF already operates at - see
For your use case, a good starting point is this “conditional routing” recipe Conditional response · Cloudflare Workers docs - your if statement doesn’t have to be based on the user agent, it can be based on the URI being /blog or /xyz.html.