Upstart configuration file (my-server.conf) and setup instructions (below) for spawning a Dart server, and a web hook for a simple continuous deployment (CI) setup.
Here's a blog post with more details: Dart + CI with a few lines of code
Dart supports server-side development. See for instance HttpServer.
Creating an Upstart config is an easy and lightweight way to spawn your server-side Dart app. It'll also respawn if necessary, e.g. in case of an uncaught exception.
If you prefer to host in Apache, have a look at mod_dart.
- Download and unzip Dart SDK:
wget http://storage.googleapis.com/dart-archive/channels/stable/release/latest/editor/darteditor-linux-x64.zip
unzip darteditor-linux-x64.zip
cp dart/dart-sdk/bin/dart /usr/bin
-
Install Upstart, if necessary
-
Copy my-server.conf to /etc/init (edit it beforehand and make sure it points to your .dart file)
-
To start the service now:
start my-server
That's it!
Optionally, create a deployment script and set up a web hook for continuous deployment.
- Logging: right now just appending to log file in /var/log, should use something better such as syslog.
- MaxHorstmann (Max Horstmann)
- Thanks to Guy for answering this question on Stack Overflow!