smm
CDCloudflare Developers
•Created by smm on 9/9/2024 in #general-help
NodeJS + React App Hosting
I am brand new to Cloudflare and Web Development in general, so apologize if this question is quite elementary in nature. I have a full stack app whose directory structure looks like this:
app
|-client
|–all client code files (including webpack.config.js)
|-server
|–all server code files (including routes.ts)
Running npm run build inside both the client and server folder, I got client-dist and server-dist folders. I repackaged these specific folders into a big dist folder and deployed using Cloudflare Pages. However, while the React frontend is running just fine, the Node Express Backend server code isn’t. When the enduser submits a request, the server throws a 404 error, with the api endpoint not being found. How can I correctly deploy the server as well? The docs mention something about functions - how do I deploy a node express code into a functions folder?
#workers-help #pages-help
35 replies