This project utilizes the Giphy API to create a Gif Explorer.
git clone 'this-repo-url' app-name
cd app-name
npm install
The template can be run in development, or in production. For development, use the following workflow.
node server/server.js
In a different terminal tab...
npm start
Create React App and the Express server are running on different processes. This is so that React can still use in memory Webpack to do hot reloads really fast.
All AJAX/fetch requests to /api
are sent back to the Express server which is serving all /api
routes from the routes/index.js
file. This is done via a proxy setup in the package.json
file.
In production, you want Express to serve up your app.
npm build
Now simply visit the Express app at 'http://localhost:3001' and you will see your app served from the 'build' folder. That's all there is to it!