Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

113
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda