pulse-express.js 1.0.4 → 1.1.0
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 +15 -4
- package/package.json +1 -1
package/Functions.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
var functions = {};
|
|
2
|
+
let startTime = null;
|
|
2
3
|
|
|
3
4
|
function pulse() {
|
|
4
5
|
return functions;
|
|
5
6
|
}
|
|
6
7
|
|
|
8
|
+
// 1. Still handles the creation, but silently marks the time
|
|
7
9
|
functions.CreateServer = function() {
|
|
8
10
|
const http = require('http');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
startTime = new Date().toLocaleTimeString();
|
|
12
|
+
return http.createServer();
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// 2. THE NEW FUNCTION: Just returns the stored time
|
|
16
|
+
functions.ServerStartedTime = function() {
|
|
17
|
+
return startTime || "Server has not been created yet!";
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// 3. The lowercase listen function we made earlier
|
|
21
|
+
functions.listen = function(serverInstance, port, callback) {
|
|
22
|
+
serverInstance.listen(port, callback);
|
|
13
23
|
};
|
|
14
24
|
|
|
15
25
|
module.exports = pulse;
|
|
26
|
+
|