Setting up play framework and dart for development and debug

Issue

I’m developing a relatively simple web app using play framework for the server and dart for the client. I’m using eclipse. Development and debug are fine on their own but how do to get them to work together?

Play has its own web server (activator) that knows how to load the entry points for each endpoint and the dart environment know how to serve up dart resources (pub serve) for dartium and (haven’t tried this yet) serve js resources for other browsers. It there a way for activator to ask the dart/pub system for resources as needed?

I tried adding a symlink from the server static resource directly to to the dart/html resources but it seems these files need to be processed by pub server before they can be used by the browser.

Solution

I guess the best way is to use a proxy with rules to forward requests for Dart resources to pub serve and play resources to activator.
This would be simple to build in Dart for example using shelf, shelf_route and shelf_proxy or nginx with a few forwarding rules.

Answered By – Günter Zöchbauer

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published.