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

125
Visualizações
Prevent/Allow the importing of static files by Node.js

I'm building a single page application and importing .js files dynamicly when needed on the client using await import(`./scripts/script.js`).

Proplem

is that the scripts folder has files for guests, members and admins, so now any one can import those files from the browser console and see or run the code in it, NOTE i dont have anything to hide in those files, but for example, i still want to prevent a guest from just imorting member or admin files at will.

NOTE: we're using Node.js for the backend)

Question

Can the server detect/intersept the incoming request for the file from the browser when import(`./scripts/script.js`) is called ? If not, is there any other way ?

Clarification

I just need a way to request js/css files from the server and have the server decide whether to send me the requested files or not.

about 4 years ago · Juan Pablo Isaza
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