Config file along with a function

I don’t have a website, I just want to deploy many functions on Netlify to process data from Typeform.

My site is : suspicious-lamport-13ced2

What I’ve tried :

  • I’ve seen the other posts on the topic but it does’t work for me because the file is not built with the other files so it’s not found
  • I’ve tried to put the nested folders but I have an error from the webpack
   ---Start netlify-lambda notification---
  WARNING: No valid single functions files (ending in .mjs, .js or .ts) were found. 
  This could be because you have nested them in a folder.
  If this is expected (e.g. you have a zipped function built somewhere else), you may ignore this.
  ---End netlify-lambda notification---
  • The option of ziping the functions is quite badly documented. The node_modules have to be putted in the zip ? Do we need to have the same structure ? Different one ?

I don’t use fs because I use a module created by the lowdb library.

Here’s my code

const { Engine, Rule } = require('json-rules-engine');

const _ = require('lodash');

const low = require('lowdb');

const path = require("path");

const FileSync = require('lowdb/adapters/FileSync');

exports.handler = (event, context, callback) => {

const adapter = new FileSync('./rules/tables-diabetes.json');

const db = low(adapter);

var allrules = db.get('rules').value();

console.log(allrules);

let response = {

statusCode: 200,

body: 'Hello, world! '

};

callback(null, response );

};

I’m considering to start using the AWS CDK instead of continue wasting my time

@Juanses, welcome to the community.

Note that our Lambda Functions are meant as a complement to sites hosted on our system, rather than a stand alone solution. That said, if that’s not your use-case, I agree that you should consider using AWS Lambda Functions directly.

For reference, our zip-it-and-ship-it functionality is documented here: GitHub - netlify/zip-it-and-ship-it: Intelligently prepare Node.js Lambda functions for deployment.