jaguar 0.6.3 copy "jaguar: ^0.6.3" to clipboard
jaguar: ^0.6.3 copied to clipboard

outdatedDart 1 only

Jaguar is a production ready server framework built for **speed, simplicity and extensiblity**

Build Status

Jaguar #

Jaguar is a production ready server framework built for speed, simplicity and extensiblity

Advantages of Jaguar #

  1. Batteries included
    1. ORM
    2. Various databases support
      1. Mongo
      2. PostgreSQL
      3. MySQL
    3. Authentication and Authorization
    4. OAuth
    5. Session management
  2. Keeps your route handlers concise and clean
  3. Bare metal speed achieved through code generation
  4. Extensible interceptor infrastructure
  5. Various ways to build routes
    1. Class-annotation based
      1. Reflection based
      2. Source generation based
    2. Mux based
  6. Extensive respository of examples
    1. Annotation based
    2. Reflection based
    3. Mux based
    4. MongoDB
    5. PostgreSQL
    6. Upload files using Jaguar

Example #

Simple routes #

Below example shows how to add routes to Jaguar.dart server.

@Api(path: '/api/book')
class BooksApi {
  /// Simple [Route] annotation. Specifies path of the route using path argument.
  @Route(path: '/books')
  int getFive(Context ctx) => 5;

  /// [methods] lets routes specify methods the route should respond to. By default,
  /// a route will respond to GET, POST, PUT, PATCH, DELETE and OPTIONS methods.
  @Route(path: '/books', methods: const <String>['GET'])
  String getName(Context ctx) => "Jaguar";

  /// [Get] is a sugar to respond to only GET requests. Similarly sugars exist for
  /// [Post], [Put], [Delete]
  @Get(path: '/books')
  String getMoto(Context ctx) => "speed, simplicity and extensiblity";

  /// [statusCode] and [headers] arguments lets route annotations specify default
  /// Http status and headers
  @Post(
      path: '/inject/httprequest',
      statusCode: 200,
      headers: const {'custom-header': 'custom data'})
  void defaultStatusAndHeader(Context ctx) {}
}

Future<Null> main(List<String> args) async {
  Jaguar jaguar = new Jaguar();
  jaguar.addApi(new JaguarBooksApi(new BooksApi()));

  await jaguar.serve();
}

Join us on Gitter #

59
likes
0
pub points
87%
popularity

Publisher

unverified uploader

Jaguar is a production ready server framework built for **speed, simplicity and extensiblity**

Homepage

License

unknown (license)

Dependencies

args, collection, http_server, intl, logging, mime, mustache, quiver_hashcode, stack_trace, yaml

More

Packages that depend on jaguar