Skip to content

Set of semi-adapters for Sanic framework to autodiscovery routes defined by adapters @route decorator

License

Notifications You must be signed in to change notification settings

pytheons/sanic-adapters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sanic-adapters-200

Sanic Adapters

Set of semi-adapters for Sanic framework to autodiscovery routes defined by adapters @route decorator instead of defining multiple resources or registering each route, resource, and blueprint in separate calls.

Why?

The idea of Adapters is to:

  • Simplify the naming convention to be more understandable by each other
  • Simplify things like registering blueprints and adding routes to blueprints
  • Aggregate each Sanic Classed Based View in one Resource class which is similar to Controller from MVC
  • Implement structures and frames as same as the framework helps to implement RESTfish or RESTFull routes in the current framework

Current version

  • Currently, the idea of RESTfish or RESTfull was implemented as a Sanic blueprint (called by this repo as RoutePart) which is composed of resources called by Sanic as Classed Based Views (HTTPMethodView) but for adapters, it is renamed to RESTResource. All binding is realized by the RESTFramework resource using the autodiscovery method which imports all routes from a defined package and build the structure required for the Sanic app.

In future

  • Add other adapters to be less RESTfish or RESTFull

About

Set of semi-adapters for Sanic framework to autodiscovery routes defined by adapters @route decorator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages