I have a built a React application and it runs fine from the local server. However, when I run npm run build, the process appears to execute correctly (creates build folder, which contains the bundled js file and the index.html file), but when I open index.html in my browser it renders nothing. I read something about static server to use node.js, the problem is, Im paying hostgator and to use a static server I need to pay for month almost the amount that Im paying for year, there is some way to run it on a server without node, apache etc? (because the project is already done)... Thanks guys appreciate!
相关问题
- How to toggle on Order in ReactJS
- Refreshing page gives Cannot GET /page_url in reac
- Adding a timeout to a render function in ReactJS
- React Native Inline style for multiple Text in sin
- Issue with React.PropTypes.func.isRequired
相关文章
- Why would we use useEffect without a dependency ar
- Is it possible to get ref of props.children?
- Why do we have to call `.done()` at the end of a p
- Stateless function components cannot be given refs
- React testing library: Test attribute / prop
- React/JestJS/Enzyme: How to test for ref function?
- Material-UI [v0.x] RaisedButton on hover styles
- Remove expo from react native
On the place you are putting your build file (screenshot at last)
You need to create
.htacces
fileCopy and paste this content in that
.htacces
It should probably work now.
[Note:] Try creating it using
file
option in your Cpanel and once it is created, edit .htacess file and paste the above code snippet (3rd and 4th Image).Something like this
Where .htacess file looks like this
adding new file
Click on .htacess file and then select edit to edit it