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 React, { Component } from 'react' | |
import { View, ScrollView } from 'react-native' | |
import { Entypo } from '@expo/vector-icons'; | |
import styled from 'styled-components'; | |
import MusicPlayer from '../components/MusicPlayer'; | |
import { list } from '../data/list'; | |
import colors from '../utils/colors'; | |
import metrics from '../utils/metrics'; |
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 React from 'react' | |
import { TouchableOpacity, FlatList } from 'react-native' | |
import styled from 'styled-components'; | |
import metrics from '../utils/metrics'; | |
export default ImageList = ({ navigation, images }) => { | |
return ( | |
<FlatList | |
data={images} |
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 React, { Component } from 'react' | |
import { ScrollView, View, TouchableOpacity, Image, FlatList } from 'react-native' | |
import styled from 'styled-components'; | |
import { AntDesign } from '@expo/vector-icons'; | |
import ImageList from '../components/ImageList'; | |
import colors from '../utils/colors'; | |
import metrics from '../utils/metrics'; | |
import { images } from '../data/images'; |
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 React, { Component } from 'react' | |
import { ScrollView, View, TouchableOpacity, Image, FlatList } from 'react-native' | |
import styled from 'styled-components'; | |
import { AntDesign } from '@expo/vector-icons'; | |
import ImageList from '../components/ImageList'; | |
import colors from '../utils/colors'; | |
import metrics from '../utils/metrics'; | |
import { images } from '../data/images'; |
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
exports.addItem = functions.https.onRequest((req, res) => { | |
return cors(req, res, () => { | |
if(req.method !== 'POST') { | |
return res.status(401).json({ | |
message: 'Not allowed' | |
}) | |
} | |
console.log(req.body) | |
const item = req.body.item | |
database.push({ item }); |
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 cors = require('cors')({ origin: true }); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const database = admin.database().ref('/items'); | |
exports.helloWorld = functions.https.onRequest((request, response) => { | |
response.send("Hello from a Severless Database!"); |
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 cors = require('cors')({ origin: true }); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const database = admin.database().ref('/items'); | |
exports.helloWorld = functions.https.onRequest((request, response) => { | |
response.send("Hello from a Severless Database!"); |
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
exports.delete = functions.https.onRequest((req, res) => { | |
return cors(req, res, () => { | |
if(req.method !== 'DELETE') { | |
return res.status(401).json({ | |
message: 'Not allowed' | |
}) | |
} | |
const id = req.query.id | |
admin.database().ref(`/items/${id}`).remove() | |
getItemsFromDatabase(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
const functions = require("firebase-functions"); | |
const cors = require('cors')({ origin: true }); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const database = admin.database().ref('/items'); | |
exports.helloWorld = functions.https.onRequest((request, response) => { | |
response.send("Hello from a Severless Database!"); |
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 cors = require('cors')({ origin: true }); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const database = admin.database().ref('/items'); | |
exports.helloWorld = functions.https.onRequest((request, response) => { | |
response.send("Hello from a Severless Database!"); |