Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/apotox/firebase-sdk-with-netlify-functions

use Firebase Admin with Netlify lambda functions
https://github.com/apotox/firebase-sdk-with-netlify-functions

firebase netlify serverless

Last synced: about 9 hours ago
JSON representation

use Firebase Admin with Netlify lambda functions

Awesome Lists containing this project

README

        

# firebase-sdk-with-netlify-functions
use Firebase Admin with Netlify lambda functions

on this project I have created two parts, the first is the front-end page (static content) and the second is the backend which is a lambda function calls firebase rest api using firebaseSDK library

## webpack.server.js
this is the most important part, bundling a Nodejs Function for Netlify function or AWS Lambda with Webpack,One of the major challenges when working with serverless functions is bundling all your node_modules into one zip file, but in my case when I tried to bundle firebase SDK with my lambda function I faced a lot of errors and missed requirements.., so decided to move the big external dependencies into a new package.json file inside “lambda” folder with the help of generate-json-webpack-plugin webpack plugin. and I edited the package.json build script ,
so after the “yarn build: server” I change the directory by the command “cd dist/server/” and then “yarn install”,
this will create a new node_modules into the lambda folder and netlify will zip it using zip-it-and-ship-it to AWS lambda function.

[full story](https://safi-eddine-posts.herokuapp.com/2019-05-24_use-Firebase-Admin-with-Netlify-lambda-functions-483d3b390e3a.html)