Firebase Hosting

447 views
Skip to first unread message

FirebaseUser91

unread,
Dec 8, 2016, 10:08:57 AM12/8/16
to Firebase Google Group
Hey,
I have made this one page site and got angularjs/bower application on top of it. When i firebase deploy it doesn't seem to grab the images/css files even tho it works just clicking on the "index.html" file (in other words localhost:xxxx only grabs the text)

Best Regards,
Sebastian

Chris Raynor

unread,
Dec 8, 2016, 3:11:15 PM12/8/16
to Firebase Google Group
Hi Sebastian,

It's difficult to tell without a link to the site or more details, but I suspect you are either a) trying to reference a path outside the 'public' directory, or b) using relative paths to URLs instead of absolute ones whilst using rewrites. Let's say your project structure looks like this (and assuming you selected the default 'public' directory when you ran `firebase init`):

/your/project/directory
  - firebase.json
  - outside/
    - main.css
  - public/
    - index.html
    - inside/
      - main.css


With regard to a) - one thing that will work if you just open public/index.html directly on your machine that won't if you use `firebase serve` on localhost, is the link:

<style type="text/css" href="../outside/main.css" />

Instead you should use (you cannot break out of the public directory):

<style type="text/css" href="/inside/main.css" />

Secondly, regarding b) if you're creating a single page app and using rewrites, if you visit localhost:5000/some/deep/path and have a relative link like this:

<style type="text/css" href="inside/main.css" />

It will try and look for /some/deep/path/inside/main.css instead of /inside/main.css

If that doesn't cover your issue, feel free to provide a link to your deployed site or more specific information

Chris
Engineer @ Firebase


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/c4b12974-ed03-40a7-9b17-f9955c8736c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages