Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
Webapp front-end structure using Firebase, Hosting vs Functions

I'm working on a small scale ERP using Firebase's free plan (for a single user). I started out hard-coding html and serving it with firebase hosting, a flow that proved uneffective in the long run. Soon I needed routes, authentication and a database, which led me to using a Express server running in a single firebase function for everything, so I could protect the routes and database access. This gives me the feel I'm doing something terribly wrong as firebase functions has an obnoxiously long URL and my API routes are just one directory away from my front-end routes.

I'm at a loss to how I should proceed but I believe there are the following options:

  • A - Go back to using firebase hosting for the front-end, meaning I have to protect the static files with a function that checks localStorage for a web token (jwt) and redirects to the login page upon failure.
  • B - Create a second firebase function for the front-end, meaning I get to use ejs and express, but I have to keep the really long URL and I have no idea how to change it (using a redirect from an owned domain only serves as an alias, the domain name doesn't persist).

A seems unsafe and B annoys me as I don't get a custom URL, how should I proceed and serve the project?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

By definition, your static code is public because there is no value in it. The value comes from the API calls that you perform to Functions or Database to fill in your static pages.

If your static code doesn't contain critical information, you can use firebase hosting to host it without any problem.

If not, you have to check the authentication AND the authorization (is that authenticated user has the permission to access that resource?) with dynamic code (i.e. a functions).

If default URL are too long, you can use a custom domain.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!