title: JS file doesn't load in html with node js
body: <p>when i launch my node js server to open NavThor.html, this one doesn't load the map script. With the render method i change current html page but I think the problem is that my map.js cannot be load. That strange because when i tried to put the script directly into the html everything is good and run succesful.
  I give you the server.js map.js and the html file.</p>
  <pre><code>'use strict'
  
  /* NavThor server */
  
  let express = require('express');
  let mustache = require('mustache-express');
  
  let app = express();
  
  /* Set up of SQLite dataBase */
  let userId = require('./dataBase/loginDb')
  
  app.engine('html', mustache());
  app.set('view engine', 'html');
  app.set('views', './views');
  app.use(express.urlencoded({extended: false}))
  app.use('/public', express.static('public'));
  
  
  app.get('/', (request, response) =&gt; {
      response.render('login')
  });
  
  app.get('/register', (request, response) =&gt; {
      response.render('register')
  })
  
  app.get('/navthor', (request, response) =&gt; {
      response.render('navthor')
  })
  
  
  app.post('/', (request, response) =&gt; {
      let loginBtn = request.body.ID;
      let userName = request.body.username
      let password = request.body.password
      if(userId.login(userName, password))
          response.render('navthor')
      else
          response.render('login')
  })
  
  app.post('/register', (request, response) =&gt; {
      let loginBtn = request.body.ID;
      let userName = request.body.username
      let password = request.body.password
      let car = request.body.car;
      userId.createAnAccount(userName, password, car)
      response.render('navthor')
  })
  
  app.post('/navthor', (request, response) =&gt; {
      response.render('navthor')
  })
  
  
  app.listen(3000, () =&gt; console.log('listening on http://localhost:3000'));
  
  ``` and the html ```&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;utf-8&quot;&gt;
      &lt;title&gt;Display a map on a webpage&lt;/title&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1,maximum-scale=1,user-scalable=no&quot;&gt;
      &lt;link href=&quot;https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css&quot; rel=&quot;stylesheet&quot;&gt;
      &lt;link href=&quot;../public/style/main_style.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;/&gt;
      &lt;script src=&quot;https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.js&quot; defer&gt;&lt;/script&gt;
      &lt;script src=&quot;server/map.js&quot; defer&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div id=&quot;map&quot;&gt;&lt;/div&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;``` 
  and map script
  ```mapboxgl.accessToken = 'pk.eyJ1IjoibW9ycGhldXM1ODI4IiwiYSI6ImNsMHYwYnFxNDB5angzYm5tbTNwdG9oZzYifQ.jmYIPRUeR77oYFVUd9ClXg';
  const map = new mapboxgl.Map({
      container: 'map', // container ID
      style: 'mapbox://styles/mapbox/streets-v11', // style URL
      center: [-74.5, 40], // starting position [lng, lat]
      zoom: 9 // starting zoom
  });
  
  </code></pre>