adonis-framework
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -13,2 +13,3 @@ 'use strict'; | ||
Request: require('./src/Request'), | ||
Session : require('./src/Session'), | ||
Env: require('./src/Env'), | ||
@@ -15,0 +16,0 @@ View: require('./src/View'), |
{ | ||
"name": "adonis-framework", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Adonis framework a loosely coupled http server for adonis application, it does all the required hard work to setup a managable http server with depdendency injection in place.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,3 +19,3 @@ 'use strict' | ||
static get inject(){ | ||
return ["Adonis/Src/Route","Adonis/Src/Request","Adonis/Src/Response","Adonis/Src/Logger"] | ||
return ["Adonis/Src/Route","Adonis/Src/Request","Adonis/Src/Response","Adonis/Src/Logger","Adonis/Src/Session"] | ||
} | ||
@@ -22,0 +22,0 @@ |
@@ -40,4 +40,4 @@ 'use strict' | ||
NodeRes.prototype.cookie = function (key, value, options) { | ||
if (!this._cookies) { | ||
this._cookies = {} | ||
if(!this.response._cookies){ | ||
this.response._cookies = {} | ||
} | ||
@@ -47,4 +47,4 @@ if (!key) { | ||
} | ||
this._cookies[key] = {key, options, value} | ||
return this | ||
this.response._cookies[key] = {key:key,options:options,value:value} | ||
return this; | ||
} | ||
@@ -71,5 +71,5 @@ | ||
*/ | ||
NodeRes.prototype.send = function (value) { | ||
if (this._cookies) { | ||
Cookies.attachObject(this.response, this._cookies) | ||
NodeRes.prototype.send = function (value){ | ||
if(this.response._cookies){ | ||
Cookies.attachObject(this.response,this.response._cookies) | ||
} | ||
@@ -76,0 +76,0 @@ this._send(value) |
@@ -14,3 +14,4 @@ 'use strict' | ||
function Server (Route, Request, Response, Logger) { | ||
function Server (Route, Request, Response, Logger, Session) { | ||
this.Logger = Logger | ||
@@ -29,5 +30,14 @@ | ||
let response = new Response(req, res) | ||
let session = new Session(req,res) | ||
let request = new Request(req) | ||
/** | ||
* setting up session on request object which | ||
* makes session methods available on | ||
* request object itself. | ||
* @type {[type]} | ||
*/ | ||
request.session = session | ||
/** | ||
* if request is for a static resource , serve static resource | ||
@@ -34,0 +44,0 @@ * and return |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75186
51
2686