diff --git a/package.json b/package.json index 44346a13..a00d17b6 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "heroku-cra-node", "version": "3.0.0", + "type": "module", "description": "How to use create-react-app with a custom Node API on Heroku", "engines": { - "node": "10.x" + "node": "14.x" }, "scripts": { "start": "node server", diff --git a/server/index.js b/server/index.js index 9b5c7d6e..97dc51ed 100644 --- a/server/index.js +++ b/server/index.js @@ -3,6 +3,9 @@ const path = require('path'); const cluster = require('cluster'); const numCPUs = require('os').cpus().length; +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) + const isDev = process.env.NODE_ENV !== 'production'; const PORT = process.env.PORT || 5000;