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

152
Visualizações
How to link html/css/js web application to nodejs locally?

new to creating web applications, so please go easy on me.

I have a web application coded using html/css/js in a folder right now. On the other hand, I have a simple node.js file called server.js that is connected to my locally hosted mySQL database to perform some simple queries using Express.

I tried to connect the html/css/js files to the node.js file like how you would include a javascript file (using src = ...), but apparently it doesn't work since the browser does not support functions such as "require()" from nodejs.

Could anyone point me in the right direction for me to connect them so that my web application can perform some simple query using the nodejs file? All these are just for my local machine since I'm not going to host the web application

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As you didn't provide any code I'm not sure what you want to do.

Assuming you want to use functionality from the node.js server:
You can't just require the node.js server. You need to run the server seperately by opening a command prompt and typing node server.js in the directory of your server files.
If you want to make queries you probably want to implement an API on your server and use the fetch() function in your browser to query data from the server.

For further help, please provide a screenshot of the folder with the files and upload all files using https://pastebin.com/.

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