jaguar 0.5.9

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

Changelog

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.5.9"

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.5.9/

Source code (hyperlinked)

www.crossdart.info/p/jaguar/0.5.9/

Uploader

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

Share