- GET request includes query parameters after the
?
symbol. Example:http://locahost:4000/forest?daylight=true
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 React from "react"; | |
import {FirebaseProvider} from "contexts/FirebaseContext"; | |
import {AuthProvider} from "contexts/AuthProvider"; | |
const App = () => { | |
return ( | |
<FirebaseProvider> | |
<AuthProvider> | |
- Initialized
npm
project withpackage.json
file. See: Getting started withnpm
. express
installed as project dependency.- Entry page (i.e.
server.js
) present in the project root.
project-root
- When in doubt, use
.send()
. It dynamically setsContent-Type
headers to match the data it sends. - When sending JSON, you can either use
.json()
or.send()
..json()
is likely less confusing.json()
uses.send()
under the hood so the resulting HTTP headers are the same.
- Initialized ExpressJS project as per this gist
project-root
├── node_modules
├── package-lock.json
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 React, {createContext, useEffect, useState} from 'react'; | |
import auth from '@react-native-firebase/auth'; // or from 'firebase/auth'; | |
import Loading from '../components/Loading'; | |
import {myFirestore} from '../common/firebase.js'; | |
export const AuthContext = createContext({}); | |
export const AuthProvider = (props) => { |
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 firestore = require('@google-cloud/firestore'); | |
const client = new firestore.v1.FirestoreAdminClient(); | |
// | |
// Add config values with CLI command: | |
// firebase functions:config:set my_app_name='{"fsBackupBucket":"gs://my-fs-backup-bucket"}' | |
// | |
const config = functions.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 React, {useContext, useState} from 'react'; | |
import {StyleSheet, Dimensions, View, Platform} from 'react-native'; | |
import {List, Button, Text} from 'react-native-paper'; | |
import * as Sentry from '@sentry/react-native'; | |
import * as Updates from 'expo-updates'; | |
import Constants from 'expo-constants'; | |
import { | |
widthPercentageToDP as wPct, |
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
#!/bin/bash | |
set -e # exit when any command fails | |
function LOG() { | |
printf 'LOG: %s %s\n' "$(date '+%b-%d %T')" "${1}" | |
} | |
function CLONE_GITHUB_REPO() { | |
# | |
# EAS_SCRT_GITHUB_CONFIG_REPOS_TOKEN is an account-level Secret stored in our Expo account's Settings |
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 React from "react"; | |
import Login from "../components/Login"; | |
import Landing from "../Pages/Landing"; | |
function Home(props) { | |
const [user, setUser] = useState(); | |
return ( | |
<div> | |
{user ? |