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!No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by