Scenario: You’ve developed a trackjs/javascript-gameshow project and are now ready to make it accessible to others. In this guide, we’ll walk you through the process of deploying your project using the run deploy
command as described in the project documentation.
First, ensure that you have the necessary prerequisites installed:
- Node.js and npm: Download and install Node.js and npm from https://nodejs.org/en/download/.
- Firebase CLI: Install Firebase CLI by running
npm install -g firebase-tools
in your terminal.
Now, navigate to your project directory:
cd audience-app
Next, verify that your package.json
file includes the following scripts:
"scripts": {
"deploy": "npm run use:project && firebase deploy"
}
The deploy
script consists of two parts:
npm run use:project
: This command is used to prepare the project for deployment by using thefirebase
command and applying thejavascript-gameshow
target.firebase deploy
: This command deploys the project to Firebase Hosting.
To deploy your project, simply run the following command:
npm run deploy
This command will execute the deploy
script, which in turn will run npm run use:project
followed by firebase deploy
. The firebase deploy
command will prompt you to log in to your Firebase account if you’re not already logged in. Once logged in, it will deploy your project to Firebase Hosting.
You can verify the deployment by visiting the URL provided in the terminal output after the deployment is complete.
Tests:
- Run
npm run deploy
and verify that the project is deployed successfully. - Visit the deployed URL and ensure that the project is accessible and functioning correctly.
- Make changes to the project and repeat the deployment process to verify that the changes are reflected in the deployed version.