My app does not work. I've reduced the code to bare basics trying to find the mistake. Any ideas?
This is the project file structure. There are no other files or folders besides the listed below.
This is the app.js content:
// jshint esversion:6
const express = require(`express`);
const ejs = require(`ejs`);
const app = express();
app.set(`view engine`, `ejs`);
app.get("/", function(req, res) {
res.render(`home`);
});
app.listen(3000, function() {
console.log(`The server is now on.`);
});
This is the home.ejs content:
<!DOCTYPE html>
<html lang=`en` dir=`ltr`>
<head>
<meta charset=`utf-8` />
<title>Secrets</title>
</head>
<body>
<h1>Secrets</h1>
</body>
</html>
I ran npm init to create this app and npm i express ejs to install the dependencies.
The error I get is the following:
Error: Failed to lookup view "home" in views directory...full path
Any ideas why this is not running properly?