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
## Active Days: | |
all except Saturday | |
## Active Hours: | |
12am-10pm | |
## Blocked Sites: | |
bbc.co.uk | |
cnn.com | |
collegehumor.com |
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
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 | |
} |
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 { https } from "firebase-functions" | |
import setupGraphQLServer from "./graphql/server" | |
/* CF for Firebase with graphql-server-express */ | |
const graphQLServer = setupGraphQLServer() | |
// https://us-central1-<project-name>.cloudfunctions.net/api | |
export const api = https.onRequest(graphQLServer) |
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": { | |
"apollo-server-express": "^1.1.3", | |
"body-parser": "^1.18.2", | |
"express": "^4.16.1", | |
"firebase-admin": "^5.4.1", | |
"firebase-functions": "^0.7.0", | |
"graphql": "^0.11.7", |
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 bodyParser from "body-parser" | |
import express from "express" | |
import { graphqlExpress, graphiqlExpress } from "graphql-server-express" | |
import schema from "./data/schema" | |
import { printSchema } from "graphql/utilities/schemaPrinter" | |
const setupGraphQLServer = () => { | |
// setup server | |
const graphQLServer = express() |
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 { makeExecutableSchema } from "graphql-tools" | |
import resolvers from "./resolvers" | |
const schema = ` | |
type Author { | |
id: Int! # the ! means that every author object _must_ have an id | |
firstName: String | |
lastName: String | |
posts: [Post] # the list of Posts by this author |
OlderNewer