node-http-context
Advanced tools
+1
-1
@@ -7,3 +7,3 @@ const Util = require('./Util'); | ||
| */ | ||
| static Initilize(app) { | ||
| static Initialize(app) { | ||
| if (app) { | ||
@@ -10,0 +10,0 @@ app.use(Util.middleware); |
+1
-1
| { | ||
| "name": "node-http-context", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Get HttpContext from anywhere", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+8
-8
@@ -10,7 +10,7 @@ # Node Http Context | ||
| const express = require('express'); | ||
| const httpContext = require('node-http-context'); | ||
| const HttpContext = require('node-http-context'); | ||
| const app = express(); | ||
| // Initialize Httpcontext middleware service | ||
| HttpContext.Initilize(app); | ||
| HttpContext.Initialize(app); | ||
| // After initialize the httpcontext we can get httpcontext anywhere | ||
@@ -22,16 +22,16 @@ ``` | ||
| ``` js | ||
| const httpContext = require('node-http-context'); | ||
| const HttpContext = require('node-http-context'); | ||
| //Node express request object from HttpContext | ||
| httpContext.Request; | ||
| HttpContext.Request; | ||
| //Node express response object from HttpContext | ||
| httpContext.Response.send(HTML/STRING); | ||
| httpContext.Response.json({JSON_Object}); | ||
| HttpContext.Response.send(HTML/STRING); | ||
| HttpContext.Response.json({JSON_Object}); | ||
| //Node express Next object from HttpContext | ||
| httpContext.Next(); | ||
| HttpContext.Next(); | ||
| //Node express session object from HttpContext | ||
| httpContext.Session; | ||
| HttpContext.Session; | ||
| ``` | ||
@@ -38,0 +38,0 @@ |
4655
-3.42%