76 lines
2.9 KiB
HTML
76 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.5.3/css/bootstrap.min.css"
|
|
integrity="sha512-oc9+XSs1H243/FRN9Rw62Fn8EtxjEYWHXRvjS43YtueEewbS6ObfXcJNyohjHqVKFPoXXUxwc+q1K7Dee6vv9g=="
|
|
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
|
|
|
|
<title>Databases (Firebase)</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<h2>Recipes</h2>
|
|
<ul>
|
|
|
|
</ul>
|
|
<form>
|
|
<label for="recipe">Add a new recipe:</label>
|
|
<div class="input-group">
|
|
<input type="text" id="recipe" class="form-control" required>
|
|
<div class="input-group-append">
|
|
<input type="submit" value="add" class="btn btn-outline-secondary">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script src="https://www.gstatic.com/firebasejs/5.9.1/firebase-app.js"></script>
|
|
<script src="https://www.gstatic.com/firebasejs/5.9.1/firebase-firestore.js"></script>
|
|
<script>
|
|
const config = {
|
|
apiKey: "AIzaSyB3okoF3eNupTW4pQAb5OjrXhALMT7WiEE",
|
|
authDomain: "learning-javascript-c2380.firebaseapp.com",
|
|
projectId: "learning-javascript-c2380",
|
|
storageBucket: "learning-javascript-c2380.appspot.com",
|
|
messagingSenderId: "731449317034",
|
|
appId: "1:731449317034:web:2e225907d58f28833ce2d3",
|
|
measurementId: "G-44VVDZGVS6"
|
|
};
|
|
firebase.initializeApp(config);
|
|
const db = firebase.firestore();
|
|
</script>
|
|
<script src="sandbox.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<!-- <script type="module">
|
|
// Import the functions you need from the SDKs you need
|
|
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.9.2/firebase-app.js";
|
|
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.9.2/firebase-analytics.js";
|
|
// TODO: Add SDKs for Firebase products that you want to use
|
|
// https://firebase.google.com/docs/web/setup#available-libraries
|
|
|
|
// Your web app's Firebase configuration
|
|
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
|
|
const firebaseConfig = {
|
|
apiKey: "AIzaSyB3okoF3eNupTW4pQAb5OjrXhALMT7WiEE",
|
|
authDomain: "learning-javascript-c2380.firebaseapp.com",
|
|
projectId: "learning-javascript-c2380",
|
|
storageBucket: "learning-javascript-c2380.appspot.com",
|
|
messagingSenderId: "731449317034",
|
|
appId: "1:731449317034:web:2e225907d58f28833ce2d3",
|
|
measurementId: "G-44VVDZGVS6"
|
|
};
|
|
|
|
// Initialize Firebase
|
|
const app = initializeApp(firebaseConfig);
|
|
const analytics = getAnalytics(app);
|
|
</script> --> |