I want to create similar environments for development, testing and deployment - and I am currently in the process of porting my app from compute engine to app engine.
Currently I have express serving static files through the standard method:
app.use(express.static('../dist'));
app.use(express.static('../public'));
Reading over the App Engine docs it is not very clear how to set this up correctly to work on localhost
& web-preview they provide and finally in production.
Are the handlers within app.yaml
necessary or can this be left to express?
Some extra clarification:
- I want to avoid
if/else
based on environment - I want a single method of serving static files, they should be accessible via a url, but also for express to send based on route logic.
And I am using the flexible app engine environment.