Search code examples
visual-studio-codeserverejsnodejs-server

How to open an EJS file with Live Server


I have a Server App created with Nodejs using "ejs" view engine.

When I start the Server and is running on the port, I click the URL and it sends me to my APP with no problem.

When I try to do it with Live server is when I am facing issues.

In Live Server instructions says: [NOTE: In case if you don't have any .html or .htm file in your workspace then you have to follow method no 4 & 5 to start server.]

That is what I do and I get redirected to, please see image below: enter image description here

Could any one help me with this issue, please ?

Thanks


Solution

  • pic1 You can see it here i wrote app.listen(3000); thats mean i can access from 3000 port on my browser.

    pic2

    like this.

    Just write to your server.js "localhost:(your-port)" and you are ready to go