Giter Club home page Giter Club logo

cowboy-automatic-route-dispatcher's People

Contributors

jczarniecki avatar psandeepunni avatar roflcopterdoge avatar sadu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cowboy-automatic-route-dispatcher's Issues

Middlewares

Write up modules that runs on all requests before/after the right controller is called. Sort of like a global pre/post hook.

Default/Landing Controller

The default or landing page (a.k.a domain root) is currently not possible to implement. By convention, an <application_name>_index.erl should respond to calls made to ' / '.

CORS fails with custom headers

When there are some custom headers (like session-id) set in request, CORS policies does not allow access (on client side). The solution is to add cowboy_req:set_resp_header(<<"access-control-allow-headers">>, <<"*">>, ...) alongside <<"access-control-allow-origin">>
in files cards_dealer.erl and cards_root_handler.erl

Configuration Options

Provide configuration options for CARDS via environment variables. This incorporates future configurable modules such as a riak client.

Controller Hooks

We'll need to facilitate hooks for controllers (init/terminate alternatives) which are also to follow the naming convention style. Can be done in two ways: one is to have a hooks folder, with filenames corresponding to controllers and methods to actions. Another is to have *_controller.erl replaced by *_hooks.erl and actions as methods.

Differentiation of POST and PRE execution hooks should reside on the method naming. For an action "act_one" the POST and PRE execution hooks may look like: pre_act_one() -> and post_act_one() ->

Authentication Module

Should have an additional parameter or way of transferring session data (viz. user login status).
Must be written in such a way that CARDS_DEALER provides a unified API for authentication with a database of choice. A session-id or an API-Token is validated, either against a stored session or passed to a user written module that decides the authentication method itself. Default(configuration free) session-id/API-Token based approach requires our own implementation of a micro OAuth protocol and a database for storage.

Websockets

Websockets are not routed at the moment. Need to implement it.

Proposed scheme:

/handle/extension[/extras]
Relates to handle_socket:extension_init(), handle_socket:extension_info(), handle_socket:extension_receive(), handle_socket:extension_terminate() where init, info and terminate are optional.

NOTE: /handle/extension would respond to HTTP(S) via handle_controller:extension()

Name

CowboyAutomaticRouteDispatcherService -> CARDS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.