This file contains 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains 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 functions = require("firebase-functions") | |
exports.helloWorld = functions.https.onRequest((request, response) => { | |
response.send("Hello from Firebase!") | |
}) |
This file contains 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
{ | |
"projects": { | |
"default": "this will be the name you gave to the firebase project you linked" | |
} | |
} |
This file contains 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 functions = require("firebase-functions") | |
const next = require("next") | |
var dev = process.env.NODE_ENV !== "production" | |
var app = next({ dev, conf: { distDir: "next" } }) | |
var handle = app.getRequestHandler() | |
exports.next = functions.https.onRequest((req, res) => { | |
console.log("File: " + req.originalUrl) // log the page.js file that is being requested | |
return app.prepare().then(() => handle(req, res)) |
This file contains 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
# src/functions/.gitignore | |
next |
This file contains 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
{ | |
"hosting": { | |
"public": "src/public", | |
"rewrites": [ | |
{ | |
"source": "**/**", | |
"function": "next" | |
} | |
] | |
}, |
This file contains 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
# src/app/.gitignore | |
.next |
This file contains 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 functions from "firebase-functions" | |
export let helloWorld = functions.https.onRequest((req, res) => { | |
let world = `from ES6 in Cloud Functions!` | |
res.status(200).send(`Hello ${world}`) | |
}) |
This file contains 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-functions-es6-example", | |
"version": "1.0.0", | |
"description": "Use ES6 to develop Cloud Functions for Firebase today!", | |
"repository": "https://github.com/jthegedus/firebase-functions-es6-example.git", | |
"license": "MIT", | |
"devDependencies": { | |
"babel-cli": "^6.26.0", | |
"babel-preset-es2015": "^6.24.1", | |
"rimraf": "^2.6.2", |
This file contains 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": "functions", | |
"description": "Cloud Functions for Firebase", | |
"dependencies": { | |
"firebase-admin": "^5.4.1", | |
"firebase-functions": "^0.7.0" | |
}, | |
"private": true | |
} |
OlderNewer