Get the closest parent folder containing a package.json file
npm install get-root-pathnpm install --save get-root-path
import { rootPath } from 'get-root-path';
path.join(rootPath, 'build/app/client');
* If you set the APP_ROOT_PATH environment variable, it will return the
value of APP_ROOT_PATH as the root path instead.
import { rootPath } from 'get-root-path';
const app = express()
.use('/', express.static(path.join(rootPath, 'build/app/client')));