I am trying to get my Dart Polymer 1.0 single page app working with pushState. I have set up nginx to route all requests to the dev server which runs when executing pub serve. Nginx also takes care of always requesting index.html instead of the real url.
The problem I am facing is that as soon as I load a url with at least one folder, the js cannot be loaded anymore.
Example
Requesting project.local loads the index.html file and works fine. The same is true for project.local/test. As soon as I try going to project.local/test/something, it stops working because the file index.bootstrap.initialize.dart is requested from project.local/test/index.bootstrap.initialize.dart and not from project.local/index.bootstrap.initialize.dart.
Source code
The whole project can be found at https://github.com/agileaddicts/blitzlicht. The index.html is where the magic happens.
How do I tell the transformer to put absolute urls into the html instead of relative ones?
pubspec.lock). The most recent is 1.0.0-rc.15. In this version you need only thepolymertransformer instead ofweb_componentsandreflectable. - Günter Zöchbauertestdirectory. Can you please add the concrete error message you get in the browser? - Günter Zöchbauerpub upgradedoesn't update polymer either. Regarding "Requesting project.local": What I meant was doing a http request in the browser. The error I get is a 404 on the initialize.dart file because of the wrong directly. I am not sure if I have to rewrite all the js and dart files (I'm still in development mode). An easier way would be to have the generated index.html file reference the files absolute instead of relative. - Sgoettschkes