Firebase hosting and Jade-lang templates

469 views
Skip to first unread message

archit...@gmail.com

unread,
Mar 2, 2016, 4:27:10 PM3/2/16
to Firebase Google Group
Hi, I'm trying to deploy a lightweight node.js static(for now) site on firebase hosting. And came across an issue with the structure I'm using.

I'm using jade templates for use with the application, however when I deploy the site my firebase site claims it can't find an index.html file which is true since there's no any .html file but rather an index.jade file. Is there a solution to this or the only way how to work with the current app would be rewriting all of my code back to .html templates instead of jade?

Thanks for any tips or solutions,
Pavel

Chris Raynor

unread,
Mar 2, 2016, 4:44:41 PM3/2/16
to Firebase Google Group
Hi Pavel,

I think you need a compile step before you deploy to Firebase Hosting - Firebase Hosting performs no server-side operations on the files in the directory you upload, so if you only upload an index.jade file, it will literally only serve up an index.jade file.

Assuming this was your firebase.json:

{
  "firebase": "your-firebase-app",
  "public": "public"
  ...
}

You could try `jade public --out dist` before deploying, which will compile the templates into a 'dist' folder. If you change your firebase.json to:

{
  "firebase": "your-firebase-app",
  "public": "dist"
  ...
}

Then you can run `firebase deploy` and you should see the content you expect

Hope that helps
Chris 

--
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/fc188906-7d4c-4b1e-b326-3de14091fa9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

archit...@gmail.com

unread,
Mar 3, 2016, 1:34:11 AM3/3/16
to Firebase Google Group
Thanks! helps a lot, however this outputs jade files into plain html, does that mean I need to change the template engine in the app itself to use html templates instead of jade engine? Seems like the only way from what I've read so far.

Thanks for help!

Pavel
Reply all
Reply to author
Forward
0 new messages