Dan Van Brunt
05/13/2022, 3:51 PMbundle copyFiles
LiveEdit/Dev mode for sst.Function
?
bundle: {
copyFiles: [
{
from: './eventSchema.js',
to: 'schemas/eventSchema.js',
},
],
},
This doesn’t seem to work for us…
const getDirectories = (source: string) =>
fs
.readdirSync(source, { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name)
const things = getDirectories(__dirname)
console.log(things)
getting []
for directoriesDan Van Brunt
05/13/2022, 3:59 PMDan Van Brunt
05/13/2022, 4:02 PMFrank
sst start
mode. (something we are planning to make the behavior consistent with sst deploy
)thdxr
05/13/2022, 7:59 PMthdxr
05/13/2022, 7:59 PMFrank
eventSchema.js
? Possible to import it?Dan Van Brunt
05/17/2022, 4:13 PMeventSchema.*json*
is a property of the EventAPI Custom Construct we created.
At build time it uses ajv-cli to compile eventSchema.*js*
and then SST bakes it into the sst.Function
so it can use middy-ajv to validate the Lambdas inputs and/or outputs.
Seems kinda helpful when you want to use HTTP-API for APIG which doesn’t support validation.