Build a Simple React Application Using Hooks

Build a Simple React Application Using Hooks

This tutorial shows you how to use React Hooks to build a simple, secure app.

James

Thank you! This was very informative. I have this working when running purely my react app. However, when serving the build with express.js, nothing seems to work anymore. What configuration has to be done on the server-side to get this solution up and running?

Matt Raible

I haven’t tried serving it up from Express. What errors are you seeing? Maybe our deploy your app guide will help?

James

Thanks for such a quick reply! I had to add a wildcard route definition that led to my build directory. I was able to get everything up and running. Something like this:

app.get(’*’, (req, res) => res.sendFile(path.join(__dirname, “…”, ‘client’, ‘build’, ‘index.html’)));