2.1 KiB
Deploy to Firebase using Pretty URLs
Firebase is a very simple and secure way to deploy a Share With Me site. You can sign up for a free account and deploy your application in less than 5 minutes.
The instructions below are based on the Firebase hosting quick start guide.
-
Install the Firebase command line tools
npm install -g firebase-toolsThe
-gflag instructsnpmto install the package globally so that you can use thefirebasecommand from any directory. You may need to install the package withsudoprivileges. -
cdinto your project directory -
Inititalize the Firebase application
firebase initFirebase asks you which app you would like to use for hosting. If you just signed up, you should see one app with a randomly-generated name. You can use that one. Otherwise go to https://www.firebase.com/account to create a new app.
-
Firebase asks you the name of your app's public directory. Enter
dist. This works because when you rungulpto build your application, PSK builds everything and places it all indist. Sodistcontains everything your application needs to run. -
Edit firebase.json add rewrites section
{ "firebase": "polymer-starter-kit", "public": "dist", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ] } -
Add
<base href="/">toheadin index.html -
Remove
hashbang: truein routing.html near bottom. The call topageshould look like this now:page(); -
Build
gulp -
Deploy
firebase deployThe URL to your live site is listed in the output.
You can see a demo of Share With Me hosted on Firebase using pretty URLs at https://polymer-starter-kit.firebaseapp.com.