pulse-express.js 1.0.2 → 1.0.3
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 +10 -7
- package/package.json +1 -1
package/Functions.js
CHANGED
|
@@ -4,17 +4,20 @@ function pulse() {
|
|
|
4
4
|
return functions
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
functions.CreateServer = function(
|
|
7
|
+
functions.CreateServer = function() {
|
|
8
8
|
const http = require('http');
|
|
9
9
|
|
|
10
|
-
// We create
|
|
11
|
-
const server = http.createServer(
|
|
12
|
-
if (callback) {
|
|
13
|
-
callback(req, res); // The user now controls res.end() here
|
|
14
|
-
}
|
|
15
|
-
});
|
|
10
|
+
// We create a "blank" server instance
|
|
11
|
+
const server = http.createServer();
|
|
16
12
|
|
|
13
|
+
// Return it immediately so the user can use it
|
|
17
14
|
return server;
|
|
18
15
|
};
|
|
19
16
|
|
|
17
|
+
|
|
18
|
+
functions.listen = function(PORT, callback) {
|
|
19
|
+
const server = functions.CreateServer();
|
|
20
|
+
server.listen(PORT, callback)
|
|
21
|
+
}
|
|
22
|
+
|
|
20
23
|
module.exports = pulse;
|