node.jsexpress

ExpressJS-Localhost not showing anything


This is my first time I am running ExpressJS. But the Localhost is not responding any data.Waiting for localhost keeps on appearing at left bottom corner. Also showing the terminal command

Below is the Code I have written

const express=require('express');
const app=express();


app.get('/',(req,res)=>
{
    
});

app.listen(3000,()=>console.log("running at 3000 port"));

I have tried to change the localhost to 4000,5000.But same error.

Additional Information: Running on Ubuntu 16.10

Any clue of whats happening over here?


Solution

  • You're not giving the browser anything to render. Try following the Hello World example in the docs and you might be pleasantly surprised:

    https://expressjs.com/en/starter/hello-world.html