I am doing a small MEAN app
My javascript inside the html is not loading
below is my express route
app.get("/getuser/:id",userRoute.getUser);
directory structure nodejs/view
****server file****
My Route Function
var getUser=function(req,res)
{
console.log("hieieieiei");
res.sendFile(path.join(__dirname + '/view/index.html'));
};
My html file name is index.html and my js file name is test.js . Both are in folder named view .
I have this mentioned in my html . Can someone help
index.html
<html>
<head lang="en">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script type="text/javascript" src="test.js"></script>
<meta charset="UTF-8">
<title> dfdfdfddddddddddddddddddd</title>
</head>
<body>
<button onclick="clicker()"></button>
</body>
</html>
test.js
function clicker()
{
alert("hi ");
}