I am new with Node JS and I have a lot of doubts, now I try to create my own static files for the server, this is my file structure
-ship.io
-node_modules
-public
-api
-css
-images
-js
-views
-server.js
-package.json
and this is my path configuration
app.use(express.static(path.join(__dirname, 'public/')));
app.use('/img',express.static(path.join(__dirname, 'public/views')));
app.use('/js',express.static(path.join(__dirname, 'public/js')));
app.use('/css',express.static(path.join(__dirname, 'public/css')));
But when I do
app.get('/', (req, res, next) => {
res.render('index.ejs',{
Title: "ship.io"
});
});
I get this error: 'c
Error: Failed to lookup view "index" in views directory