pulse-express.js 1.0.1
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/Functions.js +18 -0
- package/package.json +13 -0
package/Functions.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var functions = {}
|
|
2
|
+
|
|
3
|
+
function pulse() {
|
|
4
|
+
return functions
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
functions.CreateServer = function(callback) {
|
|
8
|
+
const http = require('http');
|
|
9
|
+
|
|
10
|
+
// We create the server and pass the req/res straight to the user
|
|
11
|
+
const server = http.createServer((req, res) => {
|
|
12
|
+
if (callback) {
|
|
13
|
+
callback(req, res); // The user now controls res.end() here
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return server;
|
|
18
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pulse-express.js",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A lightweight request timer for Express apps Credits to express",
|
|
5
|
+
"main": "Functions.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"express",
|
|
8
|
+
"middleware",
|
|
9
|
+
"logging"
|
|
10
|
+
],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|