Skip to content

Instantly share code, notes, and snippets.

@sarvghotra
Last active August 29, 2017 14:18
Show Gist options
  • Save sarvghotra/165fce3b5dd7288ccd7825134640c3d7 to your computer and use it in GitHub Desktop.
Save sarvghotra/165fce3b5dd7288ccd7825134640c3d7 to your computer and use it in GitHub Desktop.
GSoC 2017 Project: Middlewares for common web application chores

Middlewares for common web application chores

About the Project -

The project was aimed to develop JuliaWeb part of the Julia language. Specifically, to provide functionalities like routing, session, authentication etc. in order to facilitate the user to with easy and efficient web related development.

Overview of the Work Done

(For syntax and examples please follow the code link) During the summer of code period I implemented the routing features. Those features are follow:

  1. Path - Routing of the request (HTTP request) based on the path * It supports variables in the path template registered for routing. And the variable values can be accessed. * It also supports regular expressions in the path template
  2. Methods - Routing based on the method of the request
  3. Hostname - Based on the host of the request URL * Similar to the path based routing, it supports variables and regular expression
  4. Headers - Based on the header values of the request
  5. Default matching - It provides default handler (endpoint) for the requests that do not match any of the routes registered (condition for routing). By default it has HTTP.Response(404) as default handler. It also allows to set the default matching handler explicitly.

Note: In the proposal the idea was to develop the mux.jl module but later (during implementation phase) we decided for different API interface than the one already in mux.jl. So the work is done in Endpoint.jl module.

Challenges - The biggest challenge faced (and it’s still there) was to implement routing using multi dispatch approach. Current implementation is based on a different approach, it follows the approach and design followed by the Gorilla/mux library of Golang.

Future Work (left) -

  1. Routing - Error handling, query based routing, routing based on custom function
  2. Session and cookies middlewares
  3. Authentication middlewares
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment