Dart 2 and AngularDart 5 App Deployment and Run on Server Side

Issue

Environment:

  • Dart 2.0.0-dev.53.0
  • AngularDart 2.0.0-alpha+10

I would like to know what is necessary to deploy and run an AngularDart App on server side in a VM.

Durring development is being used the pub run build_runner server. The application is accessed via localhost:8080 on browser and it works fine.

To prepare to deployment a build is generated using the command pub run build_runner build -r -o build. The files are being generated on build directory ok.

The Google Cloud Compute is being used to create a VM.

Here are the basic doubts:

  1. Dart has a specific Web Server or it’s needs to install/use a tradicional Web
    Server like Apache (or which other better)?
  2. It’s necessary Dart VM or SDK on server side?
  3. To deploy the build is just copy the build package generated into Web Server on server side? No needs additional configuration?
  4. Anything more is necessary to do on server side to run the App?

Solution

1) Dart has a specific Web Server or it’s needs to install/use a traditional Web Server like Apache (or which other better)?

A Dart web app should run on any server that can run static content. We deploy samples to GitHub pages all of the time. See https://dart-lang.github.io/sample-pop_pop_win/

2) It’s necessary Dart VM or SDK on server side?

Nope!

3) To deploy the build is just copy the build package generated into Web Server on server side? No needs additional configuration?

I would run pub run build_runner build -r -o web:build assuming your app is in the web directory. This will make sure to include the packages directory without symlinks. It will also build less!

4) Anything more is necessary to do on server side to run the App?

Nope!

Answered By – Kevin Moore

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.