Using the __dirname global variable in the nodejs

Asked

Viewed 87 times

-1

Good night, you guys! Someone gets a help there, I need to leave the back-end folder and enter the front-end and get my html file using __dirname as it is in the image.inserir a descrição da imagem aqui

1 answer

1

Good evening guys, get it sorted!!

`server.get("/", (req, res) => {

var path = require('path') res.sendFile(path.normalize(__dirname + '.. /.. /front-end/src/views/index.html'))`

Browser other questions tagged

You are not signed in. Login or sign up in order to post.