Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Installation

R. de Wilde edited this page Nov 17, 2015 · 5 revisions

Redstone.dart is available as a package at pub. So, all you have to do is add it as a dependency to your app.

  • Create a new Dart package (manually or through Dart Editor)
  • Add Redstone.dart as a dependency in pubspec.yaml file
name: my_app
dependencies:
  redstone: any
  • Run pub get to update dependencies
  • Create a bin directory
  • Create a server.dart file under the bin directory
import 'package:redstone/redstone.dart' as app;

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

main() {
  app.setupConsoleLog();
  app.start();
}
  • To run the server, create a launch configuration in Dart Editor, or use the dart command:
$ dart bin/server.dart
INFO: 2014-02-24 13:16:19.086: Configured target for / [GET] : .helloWorld
INFO: 2014-02-24 13:16:19.121: Running on 0.0.0.0:8080