Static Page HTML used in Firebase Hosting
How to use it in firebase hosting
I have had a static web calculator Love Calculator using API RapidAPI
ref: https://rapidapi.com/ajith/api/love-calculator/endpoints
It’s my source code
You need to replace “x-rapidapi-key” with your key in file “js/calLoveApi.js”
on Structure of source code
Already I am ready to project for hosting firebase
Go to https://console.firebase.google.com/
Create Project
Need install NPM for firebase CLI
follow step from firebase
PS D:\Static-web\dev-static-web> npm install -g firebase-tools
If an error like here I am solved by open cmd “Run as administrator” and go to directory project.
Next step
Where is my sourcecode lol
in directory firebase generator file config
folder public if you empty name the name is “public”
In folder has a 2 pages
- index.html (config firebase)
- 404.html
and move folder “js” and “img” under the public folder
😲 Now have an index.html 2 file
from my source code (index.html) another file is firebase generate (public/index.html)
I move my source code into public/index.html don't replace it because you have a config firebase
Now my structure is
and deploy > done
https://love-calculator-7db91.web.app/
Thank you :)
ref:https://firebase.google.com/docs/hosting/
ref: https://rapidapi.com/ajith/api/love-calculator/endpoints