sprucehttp_sjs 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/index.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ A module for responding to requests within SpruceHTTP in an SJS file.
|
|
|
13
13
|
- [requestIP()](#requestip)
|
|
14
14
|
- [method()](#method)
|
|
15
15
|
- [path()](#path)
|
|
16
|
+
- [pathInfo()](#pathinfo)
|
|
16
17
|
- [query()](#query)
|
|
17
18
|
- [queryValue(key)](#queryvaluekey)
|
|
18
19
|
- [httpVersion()](#httpversion)
|
|
@@ -143,6 +144,17 @@ console.log(sjs.path());
|
|
|
143
144
|
// /index.sjs
|
|
144
145
|
```
|
|
145
146
|
|
|
147
|
+
### ``pathInfo()``:
|
|
148
|
+
Returns the request's info path.
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
// Using path /index.sjs/info
|
|
152
|
+
console.log(sjs.path());
|
|
153
|
+
console.log(sjs.pathInfo());
|
|
154
|
+
// /index.sjs
|
|
155
|
+
// /info
|
|
156
|
+
```
|
|
157
|
+
|
|
146
158
|
### ``query()``:
|
|
147
159
|
Returns the request query.
|
|
148
160
|
|
package/index.js
CHANGED
|
@@ -99,6 +99,15 @@ module.exports = {
|
|
|
99
99
|
return process.env.reqPath;
|
|
100
100
|
},
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Returns the request's info path.
|
|
104
|
+
*
|
|
105
|
+
* @returns {string} The request's info path.
|
|
106
|
+
*/
|
|
107
|
+
pathInfo: function() {
|
|
108
|
+
return process.env.reqPathInfo;
|
|
109
|
+
},
|
|
110
|
+
|
|
102
111
|
/**
|
|
103
112
|
* Returns the parsed query string of the request.
|
|
104
113
|
*
|