aqueduct 2.2.1 copy "aqueduct: ^2.2.1" to clipboard
aqueduct: ^2.2.1 copied to clipboard

discontinued
outdatedDart 1 only

Server-side framework, including routing, ORM and OAuth 2.0 in a consistent, rigorously tested framework.

Aqueduct

Build Status codecov

Gitter

Aqueduct is a server-side framework for building and deploying REST applications. It is written in Dart. Its goal to provide am integrated and consistently styled framework.

It contains behavior for routing and authorizing HTTP requests, persisting data in PostgreSQL, testing, and much more. The aqueduct command-line tool serves applications, manages database schemas and OAuth 2.0 clients, and generates OpenAPI specifications.

Aqueduct is well-tested, documented and adheres to semantic versioning.

Getting Started #

  1. Install Dart.

  2. Activate Aqueduct

     pub global activate aqueduct
    
  3. Create a new project.

     aqueduct create my_project
    

Open the project directory in an IntelliJ IDE, Atom or Visual Studio Code. All three IDEs have a Dart plugin.

Tutorials and Documentation #

Step-by-step tutorials for beginners are available here.

You can find the API reference here or you can install it in Dash.

You can find in-depth guides here.

An Example #

The only requirement of an Aqueduct application is that it contains a single RequestSink subclass. The example application below exposes POST /notes, GET /notes, GET /notes/:id, PUT /notes/:id and DELETE /notes/:id and stores data in a PostgreSQL database.

import 'package:aqueduct/aqueduct.dart';

class AppRequestSink extends RequestSink {
  AppRequestSink(ApplicationConfiguration config) : super(config) {
    logger.onRecord.listen((p) => print("$p"));

    var dataModel = new ManagedDataModel.fromCurrentMirrorSystem();
    var psc = new PostgreSQLPersistentStore.fromConnectionInfo(
        "dart", "dart", "localhost", 5432, "dart_test");

    ManagedContext.defaultContext = new ManagedContext(dataModel, psc);
  }

  @override
  void setupRouter(Router router) {
    router
      .route("/notes[/:id]")
      .generate(() => new ManagedObjectController<Note>());
  }
}

class Note extends ManagedObject<_Note> implements _Note {}
class _Note {
  @managedPrimaryKey
  int id;

  String contents;
}
117
likes
0
pub points
82%
popularity

Publisher

unverified uploader

Server-side framework, including routing, ORM and OAuth 2.0 in a consistent, rigorously tested framework.

Homepage

License

unknown (LICENSE)

Dependencies

analyzer, args, crypto, logging, matcher, password_hash, path, postgres, pub_semver, safe_config, stack_trace, yaml

More

Packages that depend on aqueduct