delightful-city-79989
05/30/2019, 4:44 AMError: Cannot find module './about.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at app.get (/var/task/__index.js:9:22)
at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5)
at next (/var/task/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/var/task/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5)
at /var/task/node_modules/express/lib/router/index.js:281:22
When I try to serve a js file using:
const server = new cloud.HttpServer("myexpress", () => {
const app = express();
app.get("/", (req, res) => {
const page = require("./about.js");
page.render(req, res);
});
return app;
});
require
points to the correct file path, but the lambda doesn't seem to recognize the file. I can even serve that file locally with this js function:
const app = express();
app.get("/", (req, res) => {
const page = require("./about.js");
page.render(req, res);
});
app.listen(3030);
white-balloon-205
cloud:functionIncludePaths
config variable to indicate custom file system paths you want to include in any functions. Without this, Pulumi will only include the source of your callback function and the required subset of node_modules in the Lambda.
See https://pulumi.io/quickstart/cloudfx/#configuration.delightful-city-79989
05/30/2019, 8:30 AM