Book Image

Dart By Example

By : David Mitchell
Book Image

Dart By Example

By: David Mitchell

Overview of this book

Table of Contents (17 chapters)
Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introducing Dart's server frameworks


The blog server in this project is written directly on top of dart:io, so you can see what is going on. As you might expect, there are a number of frameworks for Dart to help write server applications, so that basic tasks, such as serving text files, do not have to be implemented from scratch for every application.

These are all available at the pub package library.

Redstone

Redstone is described as "a server-side micro framework for the Dart platform". It uses simple code annotations to expose Dart functions to the Web. The Redstone Hello World example is very clear, and shows how annotations can hide the complexity from the developer so that they can focus on the application logic:

import 'package:redstone/server.dart' as app;

@app.Route("/")
helloWorld() => "Hello, World!";

main() {
  app.setupConsoleLog();
  app.start();
}

Note

You can find out more about Redstone at http://redstonedart.org/.

Rikulo

Rikulo modestly describes itself as a lightweight—Dart...