jaguar 0.6.11

Build Status

Jaguar

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

Advantages of Jaguar

  1. Batteries included
    1. Database
      1. Fluent query builder
      2. ORM
      3. Migration support
      4. Various databases support
        1. Mongo
        2. PostgreSQL (Query)
        3. MySQL (Query)
        4. OracleDB
        5. MS SQL
    2. Authentication and Authorization
    3. OAuth
    4. Session management
  2. Build your routes the way you prefer
    1. Controller based
      1. Reflect
      2. Generate
    2. Mux based
  3. Extensible interceptor infrastructure
  4. Extensive respository of examples
    1. Annotation based
    2. Reflection based
    3. Mux based
    4. MongoDB
    5. PostgreSQL
    6. MySQL
    7. Upload files using Jaguar

Usage

Swiftly build REST Api

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

@Api(path: '/api')
class ExampleApi {
  /// This route shows how to write JSON response in jaguar.dart.
  /// [Response] class has a static constructor method called [json]. This
  /// method encodes the given Dart built-in object to JSON string
  @Get(path: '/hello')
  Response<String> sayHello(Context ctx) => Response.json({
        "greeting": "Hello",
      });


  /// This route shows how to read JSON request and write JSON response in
  /// jaguar.dart.
  @Post(path: '/math')
  Future<Response<String>> math(Context ctx) async {
    /// [bodyAsJsonMap] method on [Request] object can be used to decode JSON
    /// body of the request into Dart built-in object
    final Map body = await ctx.req.bodyAsJsonMap();
    final int a = body['a'];
    final int b = body['b'];

    return Response.json({
      'addition': a + b,
      'subtraction': a - b,
      'multiplication': a * b,
      'division': a ~/ b,
    });
  }
}

JSON serialization with little effort

TODO

Connect to MongoDB

TODO

Connect to PostgreSQL

TODO

Add user authentication

TODO

Join us on Gitter

Changelog

0.6.11

  • Bootstrapping root APIs using bootstrap method
  • Supports package:dice based DI during bootstrapping

0.6.10

  • Jaguar shall log only unknown exceptions

0.6.9

  • Return types of route handlers are now FutureOr

0.6.8

  • Mux methods now take response members
  • Definition of RouteHandlerFunc

0.6.7

  • wrap method on Jaguar

0.6.6

  • XML rendering support
  • New error rendering mechanism
  • Debug stream

0.6.5

  • Merged jaguar_reflect and jaguar_mux into jaguar core

0.6.1

  • Global interceptors

0.6.0

  • Context based RequestHandler

0.5.10

  • Expose Logger to Interceptors and Routes
  • Configurable ErrorWriter

0.5.9

  • Fixed writing headers to response by Response

0.5.4

  • Added redirect to Response class

0.5.0

  • Removed RouteWrapper
  • Removed injection

0.2.7

  • Added properly handling List<int> response type
  • Implemented Route redirection

0.1.14

  • Remove Settings from Configuration

0.1.13

  • Removed isolate creation. Control is given to the programmer.
  • Bug fix for "Page not found!" error

0.0.3

Breaking Changes:

Annotation to build annotation from annotated function has changed.<br>

  • PreProcessorFunction has changed to PreInterceptorFunction
  • PostProcessorFunction has changed to PostInterceptorFunction

jaguar.yaml parameters has also changed

  • pre_processors has changed to pre_interceptors
  • post_processors has changed to post_interceptors

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  jaguar: "^0.6.11"

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support 'pub get'. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:jaguar/jaguar.dart';

About

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

Author

Email tejainece@gmail.com Ravi Teja Gudapati
Email segaud.kevin@gmail.com Kevin Segaud

Homepage

jaguar-dart.github.io

Documentation

www.dartdocs.org/documentation/jaguar/0.6.11/

Source code (hyperlinked)

www.crossdart.info/p/jaguar/0.6.11/

Uploader

segaud.kevin@gmail.com
tejainece@gmail.com

Published

Aug 4, 2017

Share