graphhopper: JS development cycle is broken after dropwizard merge

In order to develop JS code we did:

cd web
npm run watch

and then we were able to refresh the browser. Now the changes take effect only if we repackage the jar e.g. via

mvn clean install -DskipTests=true

It is possible to load assets directly from disc instead of looking inside the jar. I found this plugin

With a changed npm-watch task one can use it if the server was started from an IDE: watchify src/main/resources/assets/js/main-template.js -o target/classes/assets/js/main.js --debug --verbose but this is ugly as we don’t want to force JS devs to mess around with IDEs.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 31 (31 by maintainers)

Commits related to this issue

Most upvoted comments

Can confirm that this works - have changed the script and docs accordingly.

Maybe it would be cleaner if we serve the web UI files using a node server like

Yes I agree, I think we could even think about completely separating the web-demo part from this repo. This would IMHO make it easier for web developers to work with the demo. We could try to set this up using the standard node style so that developers have an easy time to find what they are looking for and don’t be scared off by this huge java project?

Please ignore me. Have to try this tomorrow 😉

Log4j is gone

Maybe we could restate the default logging configuration in config.yml (and an entries under ‘loggers’ for com.graphhopper) to make this clear ? Something like this : image

I was able to make it working through a new application class:

public class GraphHopperDebugApplication extends GraphHopperApplication {
    public static void main(String[] args) throws Exception {
        new GraphHopperDebugApplication().run(args);
    }

    @Override
    public void initialize(Bootstrap<GraphHopperServerConfiguration> bootstrap) {
        super.initialize(bootstrap);
        bootstrap.addBundle(new FileAssetsBundle("web/src/main/resources/assets", "/maps/", "index.html"));
    }
}

And called java -cp gh.jar com.graphhopper.http.GraphHopperDebugApplication server config.yml But is this the way to go? I would have thought I could just use a different command like server-debug but wasn’t able to get it working as the initialize method only offer a configfactory somehow.