0
votes

I am building the front end of a webapp in dart. How can I serve this dart app (as dart and/or javascript) from a Java Google app engine app?

I have gotten as far is "Pub build" in the dart editor to generate .css, .html, and .dart.js files. I am just not sure what do with them. I have tried copying them into the war/ folder of the GAE app and and adding the .html to the welcome-list. The html will serve but the app itself does not work.

Here are the errors I get in chrome when visiting the app engine instance:

Failed to load resource: the server responded with a status of 404 (Not Found) http://1-dot-my-app-name.appspot.com/myapp_dart.dart Uncaught ReferenceError: DartObject is not defined myapp_dart.dart.js:1741

Thanks

1

1 Answers

1
votes

I got it to work using the followings steps:

  1. Select "Pub Build" from the "Tools" menu of the Dart Editor

  2. Copy the contents of build/web from the Dart project into the war/ directory of the GAE project

  3. Open myapp_dart.html and add:

    <script src="packages/browser/interop.js"></script>
    

    directly below

    <script src="packages/browser/dart.js"></script>
    
  4. Deploy GAE app and it should work.