I am trying to deploy a react app with the backend into the same repository on github pages. It all works fine until I add the backend code to it. I can deploy the front-end, but I cannot figure out how to deploy the backend to github. In my package.json I have the followings:
....
"scripts": {
"start": "react-scripts start",
"server": "nodemon server.js",
"client": "npm run start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
}
...
I have pushed it to github. Installed gh-pages package. I have added
"homepage" : "https://[your-user-name].github.io/[your-repo-name]/"
“predeploy”:
“deploy”:
I think this is where I am going wrong. I know what predeploy and deploy should specify, but I have tried to enter a thousand different versions and I am getting error.
The simplicity of deploying a static website with GitHub Pages is a process that can be easily transferred to React applications. With just a few steps, it's easy to host a React app on GitHub Pages for free or build it to deploy on your own custom domain or subdomain.
Github pages will not execute any serverside code. You may only upload static files (html,css,js, images, etc.). In order to have a hosted backend you should look for another service like Google Cloud, AWS Lambda, Heroku, etc.
Github pages will not execute any serverside code. You may only upload static files (html,css,js, images, etc.).
In order to have a hosted backend you should look for another service like Google Cloud, AWS Lambda, Heroku, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With