Skip to main content

New site for Dart news and articles

For the latest Dart news, visit our new blog at .

New article on server-side programming with dart:io

Posted by Mads Ager

We've just published an article on how to use dart:io, our library for writing server-side code that runs on the standalone Dart VM. The library provides, among other things, access to files, directories, and processes. It also allows you to write HTTP servers like this simple one that just answers ‘Hello, world’ to any request:

main() {
  var server = new HttpServer();
  server.listen('', 8080);
  server.onRequest = (HttpRequest request, HttpResponse response) {
    response.outputStream.write('Hello, world'.charCodes());
To see further examples and find more out about how to use the dart:io library, take a look at the new article, An Introduction to the dart:io Library, on