Questions tagged [netlify-function]

Netlify functions is one of the services offered in the Netlify platform.

It uses AWS's serverless Lambda functions, but allows users to access them without an AWS account, and with management of the functions all done by Netlify. Netlify functions can be built with either JavaScript or Go.

Learn more about Netlify Functions and their abilities here.

115 questions
0
votes
0 answers

Netlify fetch data

I'm trying to figure out how to work effectively with data working through Netlify CMS My site will be on NextJS For example I create a collection Posts collection type Folder I am entering data through netlify cms, several files are being created…
i like Cola
  • 277
  • 6
  • 15
0
votes
1 answer

How to use firebase cloud functions' firestore.onWrite() in netlify lamda

I want to aggregate firestore data but I want to go with netlify lambda for the serverless functions. I want to do something like onst functions = require('firebase-functions'); const admin =…
0
votes
1 answer

Netlify-lambda serve redirects from netlify.toml

I have a working netlify-lambda setup. I run netlify-lambda locally and not in the cloud. Upon running netlify-lambda serve ./functions the functions I have defined in the /functions folder are served on localhost:9000 I also have my netlify.toml…
reencode
  • 237
  • 5
  • 15
0
votes
1 answer

How to create a md file using javascript data onto github

I'm getting form submission data through Netlify forms. I want to be able to create a md file with that same data on github when the form is submitted. So far on my submission-created.js function (triggered by client submission) I'm fetching…
0
votes
0 answers

Possible to trick AWS SDK `defaultProvider` function with a custom environment variable?

Problem: Netlify serverless functions run on AWS Lambda. So AWS_ is a reserved prefix in Netlify, meaning I can't use e.g. AWS_SECRET_ACCESS_KEY for my own environment var that I set in the Netlify admin panel. But the only way I have been auble to…
0
votes
1 answer

Netlify background function returns after it (Done executing background function handler-background)

My code in local works fine, but in Netlify it doesnot. Iam not sure whats happening. The flow is I generate invoices using easy invoice package and trying to upload it to s3 in async. But my code executes on the netlify platform wierdly. generating…
The Keeper
  • 429
  • 7
  • 16
0
votes
2 answers

How Do You Configure Create React App to Work with Netlify Lambda Functions

I am trying to use netlify lambda functions with create react app, and it is breaking my site. The repo was made by running npx create-react-app my-app-name, and is the standard create react app boilerplate. File…
Maiya
  • 932
  • 2
  • 10
  • 26
0
votes
1 answer

Stripe Webhook error 400 with netlify functions

I have set up payments with stripe using Netlify function by following this article https://www.netlify.com/blog/2020/04/22/automate-order-fulfillment-w/stripe-webhooks-netlify-functions/ and in my Stripe dashboard I get error saying that: Webhook…
seven
  • 1,183
  • 14
  • 33
0
votes
1 answer

Getting an error message n is not a function

I am writing a serverless netlify function when I hit /:uid endpoint, it shows me this error message n is not a function but when I hit / endpoint, it doesn't throw an error. Please help me with this. src/api.js file code const express =…
r121
  • 2,478
  • 8
  • 25
  • 44
0
votes
1 answer

Enforce same-origin in Netlify function? (cors)

I am looking to enforce that requests come from the desired origin in process.env.URL in my Netlify site. But currently I can both cURL and make requests with Postman and get a response data back with a statusCode 200. Am I missing…
0
votes
0 answers

Error retrieving data from backend server on Netlify

I have a Netlify project running which contains two git submodules. Module 1 is a frontend server running on React. Module 2 is an Express server that retrieves data and returns it. I am now trying to fetch a URL in order to retrieve the correct…
0
votes
1 answer

304 Error using Netlify Functions in create-react-app

※Edited some code after posting the question. New Code below. I am trying to use Netlify Functions to hide my API key to fetch data. However, it returns a 304 and seems to be not working. The code below returns an error "SyntaxError: Unexpected…
0
votes
0 answers

Parsing multi part form data with Busyboy getting objects in a weird format

Unable to parse multipart form data as the return data from Busyboy is in some weird format. I can see the correct values in the terminal however it contains some symbols so couldn't JSON.parse it. JSON.parse(fields.values) Does anyone know which…
Harsha Murupudi
  • 579
  • 1
  • 6
  • 19
0
votes
1 answer

`express` object from apollo-server-lambda context is undefined

I am following this guide to make my apollo server run with Netlify functions. It works fine for non authenticated requests, but I have problems when I need to read the headers. The guide says that I can get the req from the express object as shown…
0
votes
0 answers

how can i access variables values from a netlify function to call API?

hope someone can help me. I'm trying to deploy a web app on netlify, but i don't know how to call the API the right way, providing the right value. this is my netlify function file: const fetch = require('node-fetch'); exports.handler = async event…