-
Notifications
You must be signed in to change notification settings - Fork 0
Quickstart
wasita edited this page Nov 1, 2023
·
1 revision
Firebase Project ID: jspsych-firebase-template
-
Dartmouth previously allowed you to make Firebase projects with your Dartmouth.edu email, but I recently tried to do so and it seems that they removed permissions. Now, you must make a Firebase project with a Gmail.com account.
-
Once you've successfully created a Firebase project through the console/website GUI, you can add the project-specific SDK information to your
index.html
:
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.5.2/firebase-app.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
const firebaseConfig = {
apiKey: "AIzaSyDVRPEkqZVRCZGaf0TkP6PsYBKbEdumIgc",
authDomain: "jspsych-firebase-template.firebaseapp.com",
projectId: "jspsych-firebase-template",
storageBucket: "jspsych-firebase-template.appspot.com",
messagingSenderId: "471080365978",
appId: "1:471080365978:web:e67e5176c690ada9631423"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
</script>
npm install firebase-tools
-
firebase login
- Make sure you’re logged into the Gmail account that the Firebase project was made under
-
firebase init
— follow the command instructions- Select hosting
- You pretty much safely press
enter
and accept the default options. However, when it comes to the question of where you want to deploy files from and the default option given to you is apublic
folder, override this default with.
This specifies you want to deploy from the repo root directory. That is, theindex.html
task file should be in the 'uppermost' directory in the GitHub repo.
-
firebase deploy
- Once you want to update and/or push any changes you’ve made to your task site, so it can be accessible online, you can run this command
- For me, the hosting URL is:
https://jspsych-firebase-template.web.app/