I'm trying to deploy a simple Node.js express application to Google App Engine (flex environment).
The application runs great locally. When I try to deploy to App Engine, I get the following error:
Error: Cannot find module './app/models/xyz'
My app directory structure looks like:
server.js
app/models/xyz.js
In server.js
, I require the xyz.js
file as follows:
const Xyz = require('./app/models/xyz');
If I move the xyz.js
file to the same root folder as server.js
, everything deploys and works great.
This is the first node.js app that I try to deploy to Google App Engine. Do I need to configure the path to app/models/xyz.js
in my app.yaml
? None of the reference applications seem to require this?