const fdk = require('@fnproject/fdk')
const utils = require('./utils') // Look here
fdk.handle(function (input) {
let name = 'World'
if (input.name) {
name = input.name
}
console.log('\nInside Node Hello World function')
return { message: 'Hello ' + name }
})
So, is there any other way to import an external JavaScript file besides installing dependencies via npm i and moving it to the function directory when needed?
Output of fn version (CLI command):
Client version is latest version: 0.6.26
Server version: ?
Description
Here is the directory structure of my project:
and
utils.js
just like:When I import utils.js file inside add/func.js like:
this API
/add
will return 502 error.However, when I move utils.js into the
/add/
directory, this API works normally.So, is there any other way to import an external JavaScript file besides installing dependencies via
npm i
and moving it to the function directory when needed?Output of
fn version
(CLI command):Additional environment details (OSX, Linux, flags, etc.): MacOS Monterey 12.2.1