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
| type options = { | |
| . | |
| "dir": string, | |
| "key": string | |
| }; | |
| let defaultOptions: options = {"dir": "conf/", "key": "configuration"}; | |
| let createConf = (~opts=defaultOptions, ()) => Js.log(opts); |
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
| +- dist/ # compiled code | |
| | | | |
| | +- index.js # CF entrypoint, defined by pkg.json "main" field | |
| | +- index.js.map # maps compiled to raw source in ../src/ | |
| +- node_modules/ # ignored by firebase-tools on upload | |
| +- src/ # raw source code to compile | |
| | | | |
| | +- index.<ext> # entrypoint to compile | |
| +- <config file> # config file depending on the tool | |
| +- .firebaserc # firebase project identification config |
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 { onNewUser } from "./onNewUser/function"; | |
| // functions in this object will be prefixed with "users" | |
| // Eg: auth-onNewUser | |
| const auth = { onNewUser }; | |
| export { auth }; |
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 functions = require('firebase-functions'); | |
| exports.englishSyntax = functions.pubsub | |
| .schedule('every 10 minutes') | |
| .timeZone('Australia/NSW') | |
| .onRun(context => { | |
| console.log('triggered every 10 minutes', context); | |
| }); | |
| exports.cronSyntax = functions.pubsub |
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
| FROM node:10-alpine | |
| RUN apk add ca-certificates | |
| ENV NODE_ENV=production | |
| WORKDIR /urs/src/app | |
| COPY package.json yarn.lock ./ | |
| RUN yarn install --production |
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 functions = require('firebase-functions'); | |
| const admin = require('firebase-admin'); | |
| admin.initializeApp(); | |
| // Express Servers | |
| const {simpleServer, corsServer, cleanPathServer} = require('./server'); | |
| // HTTP Cloud Functions | |
| const simple = functions.https.onRequest(simpleServer); |
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 {https} from 'firebase-functions'; | |
| import gqlServer from './graphql/server'; | |
| const server = gqlServer(); | |
| // Graphql api | |
| // https://us-central1-<project-name>.cloudfunctions.net/api/ | |
| const api = https.onRequest(server); | |
| export {api}; |
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.helloWorld = (req, res) => { | |
| res.send('Hello, World'); | |
| }; |
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 admin = require("firebase-admin"); | |
| const functions = require("firebase-functions"); | |
| const next = require("next"); | |
| const config = require("./next.config"); | |
| admin.initializeApp(); | |
| const dev = process.env.NODE_ENV !== "production"; | |
| const app = next({ | |
| dev, |
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
| ┌ ○ / <-- static | |
| ├ ○ /404 <-- static | |
| ├ ● /about <-- SSG page | |
| ├ λ /blog <-- SSR page | |
| ├ ● /blog/[pid] <-- SSG dynamic route with fallback:true | |
| └ ○ /blog/not-a-post <-- static | |
| + First Load JS shared by all | |
| ├ static/pages/_app.js | |
| ├ chunks/commons.some_uid.js | |
| ├ chunks/framework.some_uid.js |