jaguar-dart / jaguar Goto Github PK
View Code? Open in Web Editor NEWJaguar, a server framework built for speed, simplicity and extensible. ORM, Session, Authentication & Authorization, OAuth
Home Page: http://jaguar-dart.github.io
Jaguar, a server framework built for speed, simplicity and extensible. ORM, Session, Authentication & Authorization, OAuth
Home Page: http://jaguar-dart.github.io
Response should handle writing List properly using httpResponse.add(value)
A way to upgrade Http connection to websocket and injecting the upgraded websocket to route.
Should this need @Websocket()
annotation, instead of @Route()
Create video demos to showcase jaguar features
Interceptor to support JWT authentication
@Get()
Future<User> getUser(
@Input(MongoDb) Db db,
@Input(UserAuthorizer) User user
) {
//TODO ...
}
Hi.
As talked on gitter when u use @WrapEncodeToJson()
it removes the headers and the client dont know wath type of encode uses
Example code where it happens
@Get(
headers: const {'Content-Language': 'es-ES','charset':'UTF-8'})
@WrapPostgresDb(campusConnection)
@WrapEncodeToJson()
Future<List<Map>> getAll(@Input(PostgresDb) Connection db,
{int offset: 0,
int limit: 10,
int formato,
int evento,
int plataforma,
String aparece,
int tema}) async {
Adapter _adapter = new PgAdapter.FromConnection(db);
bean = await new ContenidoBean(_adapter);
Map parameters = {
'formato': formato,
'evento': evento,
'plataforma': plataforma,
'aparece': aparece,
'tema': tema
};
return bean.findWithOptionals(limit, offset, parameters);
}
Display route name and input name when inputs dont match for routes and interceptors.
Also display source line info of the route.
Needs a MockWebsocket
class similar to MockHttpRequest
to mock and test websocket api.
A separate package for generic ORM
@Get(path: '/ping')
String ping({num test: 1, int test1: 3, double test2: 4.0}) {
return "pong $test $test1 $test2";
}
if you don't provide test
in the query param test
will be null
instead of 1
Add convenient route annotations for common methods: Get, Put, Post, Delete
Google OAuth authenticator that plays well with jaguar_session and jaguar_auth
Create a separate package to handle CORS
Should be could to not create the queryParams variable if not needed.
Right now interceptors cannot release its resources during exception
Facebook OAuth authenticator that plays well with jaguar_session and jaguar_auth
jaguar generator crashes if query parameter has no default value.
@Api(path: '/api')
class ExampleApi implements ApiInterface {
@Route('/user')
String user({String id}) => "{'Id': $id}";
}
@Get(path: '/defStringParam')
String defStringParam({String strParam: 'default'}) => strParam;
In the generated code, the string 'default'
is not quoted.
Add possibility to match routes based on wild cards that do not require defining path variables.
/base/url/*
must match all paths with prefix segments ['base', 'url']
Integrate shelf into jaguar so that shelf handlers can be added to jaguar configuration and shelf middleware can be added to jaguar routes.
Hi,
I liked the project and I am studying it as an alternative to redstone.
We need the documentation.
How do we mock a request?
How do we use session? Are variables zoned?
etc.
thanks
An injector that supports authentication through OAuth 2.0
in api.dart
import "users.dart";
part 'api.g.dart';
@Api(path: 'api')
class ExampleApi extends Object with _$JaguarMedisApi {
@Group(path: 'users')
UsersGroup users = new UsersGroup();
}
in users.dart
class UsersGroup {
@Route('/')
String get() => "user";
}
Swagger API specification must be generated from metadata parsed during code generation
RegExp are not working because in the generated code they are missing inside the Route instanciation.
List<Route> _routes = <Route>[
new Route(r"/:file", methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]),
];
should be:
List<Route> _routes = <Route>[
new Route(r"/:file", methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], pathRegEx: {"file": "whatever here"}),
];
Something like that is not accepted and should be
@Api(path: 'api')
class MedisApi extends Object with _$JaguarMedisApi {
@Group(path: 'users')
UsersResource users = new UsersResource();
}
We need a way to fold multiple interceptors into one to save a lot of lines
@InterceptorClass()
class Auth extends Interceptor {
void pre() {}
void post() {}
}
@InterceptorClass()
class FetchLogedInUser extends Interceptor {
void pre() {}
void post() {}
}
//TODO somehow this should wrap Auth and FetchLogedInUser
@InterceptorClass()
class AuthAndFetchUser extends Interceptor {
void pre() {}
void post() {}
}
An Input requester to request cookie and header as parameters to routes and injectors
Hi.
Today i was implementing he autogenerated beans and changed somo code and when you try to execute it ikt throws this exception.
Dumping native stack trace for thread 174d
[0x00000000008dc1ca] dart::SnapshotReader::ProcessDeferredCanonicalizations()
[0x00000000008dc1ca] dart::SnapshotReader::ProcessDeferredCanonicalizations()
[0x00000000008dc594] dart::SnapshotReader::ReadObject()
[0x0000000000745ff0] Unknown symbol
[0x0000000000750581] Unknown symbol
[0x00000000007713b4] dart::MessageHandlerTask::Run()
-- End of DumpStackTrace
This is the main
import 'package:jaguar/jaguar.dart' as jaguar;
import 'package:campusAPI/api.dart';
main(List<String> args) async {
ExampleApi ea = new ExampleApi();
jaguar.Configuration configuration =
new jaguar.Configuration(multiThread: false,port:8756);
configuration.addApi(ea);
await jaguar.serve(configuration);
}
and this is the api part
library api;
import 'dart:async';
import 'dart:io';
import 'package:jaguar/jaguar.dart';
import 'package:jaguar/interceptors.dart';
import 'package:campusAPI/db/db.dart';
part 'api.g.dart';
@RouteGroup(path: '/media')
class ExampleRouteGroup extends _$JaguarExampleRouteGroup {
ContenidoBean CB = new ContenidoBean(new PgAdapter('asdasdasdasdasda'));
@Get()
@WrapEncodeJsonableList()
Future<List> mediaAll() => CB.findAll();
@Get(path: '/:id', pathRegEx: const {'id': r'^[0-9]+$'})
@WrapEncodeJsonableList()
Future<List> mediaOne() => CB.findAll();
}
@Api(path: '/campus')
class ExampleApi extends _$JaguarExampleApi {
@Group()
final ExampleRouteGroup exampleRoutes = new ExampleRouteGroup();
@Route(path: '/version', methods: const ['GET'])
num version() => 0.1;
}
RouteWrapper's template type WrapperType
must extend Interceptor
An interceptor to support rendering of Mustache templates
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.