broad-answer-39628
11/25/2021, 9:32 AM"use strict";
const cloud = require("@pulumi/cloud-aws");
const server = new cloud.HttpServer("reviews-getter", () => {
const app = require('./app/app');
return app;
})
module.exports = server;
./app/app.js
is the express object exported from another file.
The problem is that after pulumi up
, index.js is successfully converted into a lambda function but the ./app folder is not included in the code. I therefore get an error saying that module ‘./app/app’ cannot be found. Moving the code in ./app/app.js into index.js does not help either because of the other dependencies in ./app which cannot be accessed.
cloud:functionIncludePaths: ./app/
is already declared in the config so could someone please advise on how to resolve this? Thanks in advance!