Answer the question
In order to leave comments, you need to log in
How to connect js/css files to NodeJS?
There is such a hierarchy of files:
I want to include css, js files in layout.ejs
<link rel = "stylesheet" type = "text/css" href = "../style/table.css" />
<link rel = "stylesheet" type = "text/css" href = "../style/editModal.css" />
<script src="https://unpkg.com/@ag-grid-enterprise/[email protected]/dist/ag-grid-enterprise.min.js"></script>
<script src="../javaScript/table.js"></script>
app.set('views', __dirname + '/views/layouts');
app.set("view engine", "ejs")
app.use(express.static(path.join(__dirname, 'views')));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question