0
I’m making a system using Handlebars on Nodejs, when I try to get my javascript code for it, it doesn’t find it. The solution I found was to send my javascript as a page by Node and then pick it up by localhost, but I believe that is not the best solution.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script type="text/javascript" src="../../js/mudartexto.js"></script>
<title>postagens Node.js</title>
</head>
<body>
{{{body}}}
</body>
</html>
error: GET http://localhost:8081/js/mudartext.js net::ERR_ABORTED 404 (Not Found)
you checked the path? how is the structure of your application?
– Leandro Angelo
yes, the path is correct, I have tested it differently and everything indicates that it is correct
– Erico Calasans