If all you want is for the map to initialise at a location depending on the URL, you can achieve this by initialising the map with:

const map = new mapboxgl.Map({
   // ...
   // hash: true
});

When you move the map around, the URL will update, something like localhost:8000/#15/-144.9,-37.8.

If this wasn't what you were asking, I suggest putting more details in your question.