I have

```
router.get('/',function(req,res){
  res.sendFile('index.html', { root: __dirname });
  //__dirname : It will resolve to your project folder.
});

```

calling index.html file. It has script tag with script.

Calling of environmental variable in app.js file works well

```
var port =process.env.port ||process.env.PORT || 3000;

```

but error starts if I run this in the script tag of index.html

How can I access PORT environmental variable in that script tag? Is there way to run separate index.js file
(I used `<script src="./index.js"/>` and 

```
alert()
console.log("s")

```

in that file, but it did nothing)