jaguar_dev_proxy

Jaguar reverse proxy implementation for dev

Usage

A simple usage example:

import 'package:jaguar/jaguar.dart';
import 'package:jaguar/interceptors.dart';
import 'package:jaguar_dev_proxy/jaguar_dev_proxy.dart';
import 'package:jaguar_reflect/jaguar_reflect.dart';

@Api()
class ExampleApi {
  @Get(path: '/api/user')
  @WrapEncodeMapToJson()
  Map getUser() => {
        'name': 'teja',
      };

  @Get(path: '/client/version')
  String getVersion() => '0.1';
}

main() async {
  final api = new JaguarReflected(new ExampleApi());

  // Proxy all html client requests to pub server
  final proxy = new PrefixedProxyServer(
      '/client', 'http://localhost:63342/jaguar_dev_proxy/web/');

  Configuration conf = new Configuration(address: 'localhost', port: 8085);
  conf.addApi(proxy);
  conf.addApi(api);

  await serve(conf);
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Libraries

jaguar_dev_proxy

Support for doing something awesome.