This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var path = require('path'); | |
| module.exports = { | |
| entry: path.resolve(__dirname, 'src') + '/app/index.js', | |
| output: { | |
| path: path.resolve(__dirname, 'dist') + '/app', | |
| filename: 'bundle.js', | |
| publicPath: '/app/' | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x14e0e2b13814526797b6F10676d69498bCD9b411 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [build] | |
| command = "yarn build" | |
| publish = "dist/client" | |
| functions = "dist/server" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require("path"); | |
| const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
| module.exports = { | |
| entry: { | |
| main: "./src/index.js" | |
| }, | |
| output: { | |
| filename: "main.js", | |
| path: path.resolve("dist/client") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "firebase-sdk-with-netlify-functions", | |
| "version": "1.0.0", | |
| "description": "use Firebase Admin with Netlify lambda functions… free", | |
| "private": true, | |
| "main": "index.cjs.js", | |
| "module": "index.js", | |
| "homepage": "https://github.com/apotox/firebase-sdk-with-netlify-functions", | |
| "scripts": { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "start": "concurrently 'yarn start:client' 'yarn start:server'", | |
| "start:client": "webpack-dev-server --mode development --hot --config webpack.client.js", | |
| "start:server": "netlify-lambda serve src/lambda -c webpack.server.js", | |
| "build": "yarn build:client && yarn build:server && cd dist/server/ && yarn install", | |
| "build:client": "webpack --mode production --config webpack.client.js", | |
| "build:server": "netlify-lambda build src/lambda -c webpack.server.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //webpack.config.js | |
| require('dotenv').config() | |
| const path = require('path'); | |
| const pkg = require('./package') | |
| const GenerateJsonPlugin = require('generate-json-webpack-plugin') | |
| const externals = [ | |
| 'firebase-admin', | |
| 'lodash' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.handler = function(event, context, callback) { | |
| // your server-side functionality | |
| callback(null,{ | |
| statusCode: 200, | |
| body: `hi , my name is Safi @saphidev` | |
| }) | |
| } | |
| //or async function | |
| exports.handler = async function(event, context) { | |
| // your server-side functionality |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as admin from 'firebase-admin'; | |
| //global.self = {fetch: require('node-fetch')} | |
| var serviceAccount = { | |
| //..... | |
| } | |
| const app = admin.initializeApp({ | |
| credential: admin.credential.cert(serviceAccount), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "os" | |
| "time" | |
| ) |
OlderNewer