Hoang Nhat Truong
Hoang Nhat Truong

Reputation: 1

import files in netlify serverles function

I have an express app that is wrapped by serverless-http.I am currently handling the endpoint api/ for a frontend submission in netlify/functions which lives in the root directory of my project.In netlify/functions/api I also have some other services such as Twilio, nodemailer and firebase-admin to save user information to Firestore.Currently, I have put those services above in separate files in netlify/functions/utils.In /utils, i have an index.js file to import all other services.After that, I import this index.js to my api.js and wrapped it with serverless function.

index.js in utils/ successfully included all other function files but when api.js import app from utils/ , the code only execute untill the line of redirect to other page and the rest of the other function calls are not working

Currently, I have put those services above in separate files in netlify/functions/utils.In /utils, i have an index.js file to import all other services.After that, I import this index.js to my api.js and wrapped it with serverless function.

index.js in utils/ successfully included all other function files but when api.js import app from utils/ , the code only execute untill the line of redirect to other page and the rest of the other function calls are not working

I am expecting all the service function calls in netlify/functions/untils/index.js works when my handling my form-submission

Upvotes: 0

Views: 51

Answers (0)

Related Questions