# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
node_modules
.pnp
.pnp.js
# testing
coverage
# production
build
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
yarn.lock
Backend Setup
Create index.js inside the server folder
constpath=require('path')constexpress=require('express')constdata=require('./db/fakedata.json')constapp=express()if(process.env.NODE_ENV==='production'){app.use(express.static(path.join(__dirname,'../client/build')))}app.get("/api/all",(req,res)=>{res.json(data)})if(process.env.NODE_ENV==='production'){app.get('*',(req,res)=>{res.sendFile(path.join(__dirname,'../client/build/index.html'))})}constPORT=process.env.PORT||3001app.listen(PORT,()=>{console.log(`Listening on port ${PORT}`)})