Get and render some file with app.get (node)

how are you guys?

Today I need help with my application in Node, I appreciate if someone can help me.

I have my routes set up on my general configuration file, and all my app.gets are rendering files in the folder views, inside the server folder, just like this:

SERVER FOLDER
 |
 |- VIEWS FOLDER WITH THE SEVERAL EJS TEMPLATES
 |  |
 |  -- RESERVATIONS.EJS
 |- CONFIGURATIONFILE.JS

So, Just to help you to help me.. i have this get example that are working perfectly:

app.get('/reservas', ensureAuthenticated, function(req, res) {
        res.render('reservations');
    });

I have this two configurations in my file configuration file:

app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');

Now, the real problem.

I have a public folder that is a sibling folder of the folder server, and i have this login.ejs and I need to render it in the route /, so i have this:

app.get('/', function (req, res) {
    res.render('login');
});

but it is not pulling the file inside the public folder..

If anyone can help me, I appreciate it.

Although I wouldn't suggest doing it this way... something like this will solve your immediate problem:

res.render('../public/login');

But, if you have views you are rendering on the server you should keep them in the same place. If you have views that you want to share on the client AND server you could use grunt, gulp, etc. to precompile those views into a single js file that lives in your public folder.