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.
Files changed (2) hide show
  1. package/Functions.js +10 -7
  2. 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(callback) {
7
+ functions.CreateServer = function() {
8
8
  const http = require('http');
9
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
- });
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulse-express.js",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A lightweight request timer for Express apps Credits to express",
5
5
  "main": "Functions.js",
6
6
  "keywords": [