Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mern heroku Error: ENOENT: no such file or directory

  if (process.env.NODE_ENV) {
    app.use(express.static(path.resolve(process.cwd(), 'client/build')))
    app.get('*', (req, res) => {
      res.sendFile(path.resolve(process.cwd(), 'client/build/index.html'))
    })
  }
 
PREVIOUS NEXT
Tagged: #mern #heroku #file #directory
ADD COMMENT
Topic
Name
8+3 =