adonis-framework
Advanced tools
Comparing version 1.1.3 to 1.2.0
{ | ||
"name": "adonis-framework", | ||
"version": "1.1.3", | ||
"version": "1.2.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", |
@@ -97,10 +97,11 @@ 'use strict' | ||
* @description start http server on a given port | ||
* @param {String} host | ||
* @param {Number} port | ||
* @public | ||
*/ | ||
Server.prototype.start = function (port) { | ||
Server.prototype.start = function (host, port) { | ||
this.Logger.info('serving app on port %s', port) | ||
this.serverInstance.listen(port) | ||
this.serverInstance.listen(port, host) | ||
} | ||
module.exports = Server |
@@ -25,5 +25,5 @@ 'use strict' | ||
switch(typeof(value)){ | ||
/** | ||
* if value is an object , convert | ||
* if value is an object , convert | ||
* it to string using stringify. | ||
@@ -34,3 +34,3 @@ */ | ||
break | ||
/** | ||
@@ -58,3 +58,3 @@ * if value is a number , convert it to | ||
* converting string values back to original datatype | ||
* based upon their type | ||
* based upon their type | ||
* @param {Object} value | ||
@@ -112,3 +112,3 @@ * @return {Object} | ||
/** | ||
* if existing session is empty, simply push values | ||
* if existing session is empty, simply push values | ||
* on it. | ||
@@ -142,2 +142,2 @@ */ | ||
} | ||
} |
'use strict' | ||
/** | ||
* adonis-framework | ||
* adonis-framework | ||
* Copyright(c) - Harminder Virk | ||
@@ -41,3 +41,3 @@ * MIT Licensed | ||
/** | ||
* converting value to string based upon it's | ||
* converting value to string based upon it's | ||
* type. It is required as we cannot save | ||
@@ -70,3 +70,3 @@ * raw objects to cookies or to files. | ||
*/ | ||
* put (key, value) { | ||
* put (key, value, options) { | ||
/** | ||
@@ -108,3 +108,3 @@ * throwing error when key/value pair or object is not | ||
/** | ||
* here we read session id from cookie. It will be actual | ||
* here we read session id from cookie. It will be actual | ||
* session object if cookie driver is in use. Otherwise | ||
@@ -134,3 +134,4 @@ * it will be the unique session id. | ||
if(!value && typeof(key) === 'object'){ | ||
if(typeof(key) === 'object') { | ||
options = value | ||
/** | ||
@@ -161,4 +162,4 @@ * if user has passed an object , containing multiple session | ||
/** | ||
* when someone is using cookie as the session driver , we | ||
* not need a driver to save values instead we set | ||
* when someone is using cookie as the session driver , we | ||
* not need a driver to save values instead we set | ||
* session value as session id. Not a hack but | ||
@@ -171,3 +172,3 @@ * little confusing | ||
/** | ||
* here we create session id , as data storage is | ||
* here we create session id , as data storage is | ||
* not cookie and need way to reference session | ||
@@ -181,3 +182,3 @@ * values | ||
/** | ||
* generating cookie string to push to cookies | ||
* generating cookie string to push to cookies | ||
* which will be used by response object | ||
@@ -187,6 +188,6 @@ * while making response | ||
*/ | ||
const session = {key:this.constructor.sessionKey,value:sessionId} | ||
const session = {key:this.constructor.sessionKey,value:sessionId, options} | ||
/** | ||
* if cookies does not exists already on response , set them | ||
* if cookies does not exists already on response , set them | ||
* as an empty object | ||
@@ -207,3 +208,3 @@ * @type {Object} | ||
* @function get | ||
* @description fetching session value for a given | ||
* @description fetching session value for a given | ||
* key | ||
@@ -217,3 +218,3 @@ * @param {String} key | ||
/** | ||
* pairs will be built by iterating over the session | ||
* pairs will be built by iterating over the session | ||
* object and transforming values back to their | ||
@@ -269,2 +270,2 @@ * original type. | ||
module.exports = SessionManager | ||
module.exports = SessionManager |
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
76423
2797