I'm new to node js. I'm trying to create a node js app and configured the app.js as follows.
var express = require ('express');
var app = express();
app.set('view engine', 'ejs');
app.use(express.static('resources'));
app.get('/', function(req, res){
res.render('index');
});
app.listen(3000);
I'm using several partial views and inject all the partials to main.ejs and finally inject main.ejs into index.ejs
To apply bootstrap and jquery to all the views, I'm calling them in the index.ejs file.
Index.ejs:
<!DOCTYPE html>
<html>
<head>
<title>New page</title>
<link type="text/css" href="/resources/bootstrap.min.css">
<script type="text/javascript" src="/resources/bootstrap.min.js"></script>
<script type="text/javascript" src="/resources/jquery-3.3.1.slim.js"></script>
</head>
<body>
<% include main.ejs %>
</body>
</html>
main.ejs
<!DOCTYPE html>
<html>
<head>
<title>New page</title>
</head>
<body>
<% include partials/partial_page.ejs %>
</body>
</html>
partial_page.ejs
<!DOCTYPE html>
<html>
<head>
<title>New page partial</title>
</head>
<body>
New Page 2
<button class="btn btn-primary">AAAA</button>
</body>
</html>
All the static files are stored in resources folder.
These bootstraps and jquery is not working and I can't get any result from them. Console has 404 error which is Bootstraps and jquery cannot be found. What is the wrong here?