0

I have an AngularDart site in a docker container, with a Nginx routing in front like: http://<ip>/site. I can attach to the container and start webdev serve.

But when I curl http://<ip>/site
I get:

Could not find web/site/index.html or any files in web/site

In my attempt to solve this I am looking at the following description:

In this routing description:

<script>
  // WARNING: DO NOT set the <base href> like this in production!
  // Details: https://webdev.dartlang.org/angular/guide/router
  (function () {
    var m = document.location.pathname.match(/^(\/[-\w]+)+\/web($|\/)/);
    document.write('<base href="' + (m ? m[0] : '/') + '" />');
  }());
</script>

Update: If I fix set:

document.write('<base href="/site/"/>');

It works with an error in the browser unable to find main.js - but it still works.

Do you know how to fix the routing problem og maybe just what is the /web($|\/)/ doing?

3
  • Is this for production or development? Oct 19, 2018 at 8:57
  • It is for development. If production I think we should set a fixed/constant ref in <base href=/site/.
    – Chris G.
    Oct 19, 2018 at 9:00
  • It must be something with the routing as it works if I run it on localhost. I just need to run in container as it connect to other containers on kubernetes.
    – Chris G.
    Oct 19, 2018 at 9:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.