server-up-ndot 1.2.0-beta.2 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "server-up-ndot",
3
- "version": "1.2.0-beta.2",
3
+ "version": "1.2.0",
4
4
  "description": "server toolkit",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -52,7 +52,8 @@
52
52
  "validator": "*",
53
53
  "ws": "*",
54
54
  "xml2js": "*",
55
- "yargs": "*"
55
+ "yargs": "*",
56
+ "dotenv": "*"
56
57
  },
57
58
  "keywords": [],
58
59
  "author": "",
package/readme.md CHANGED
@@ -1,12 +1,3 @@
1
- ⚠️ beta.1 version.
2
- May contain bugs. Possibly many.
3
-
4
- If you find one, don't panic.
5
- If you panic, your computer might also kernel panic!
6
-
7
- At the same time, my nickname "segfaultandsegmentationfault"
8
- may be activated.
9
-
10
1
  # server-up-ndot
11
2
 
12
3
  Simple server generator and auto library install for Node.js.
@@ -34,6 +25,16 @@ npx server-up-ndot create myserver
34
25
 
35
26
  ## Patch Notes
36
27
 
28
+ ### 1.2.0
29
+ - This is now official release!
30
+ - bug patch
31
+
32
+ ### 1.2.0-beta.3(pre-release)
33
+ - the new .env details!
34
+ - html path
35
+ - msg for /
36
+ - Final release comming soon!
37
+
37
38
  ### 1.2.0-beta.1(pre-release)
38
39
  - Final release coming soon!
39
40
 
@@ -1 +1,3 @@
1
1
  PORT=3000
2
+ MSG_ROOT="hello,npx server toolkit!"
3
+ HTML_FILE="nonehtml.html"
@@ -1,17 +1,24 @@
1
1
  const express = require('express');
2
2
  const cors = require('cors');
3
3
  const net = require('net');
4
+ const path = require('path');
4
5
  require('dotenv').config();
5
6
 
6
7
  const app = express();
7
8
  const startPort = process.env.PORT || 3000;
8
-
9
+ const msg = process.env.MSG_ROOT || "segfaultandsegmentationfault";
10
+ const html = process.env.HTML_FILE || "nonehtml.html"
9
11
  app.use(cors());
10
12
  app.use(express.json());
11
13
 
12
14
  // GET
13
15
  app.get('/', (req, res) => {
14
- res.send('segfaultandsegmentationfault');
16
+ res.send(`${msg}`);
17
+ });
18
+
19
+ //html
20
+ app.get('/html', (req, res) => {
21
+ res.sendFile(path.join(__dirname, `${html}`));
15
22
  });
16
23
 
17
24
  // POST
@@ -40,7 +47,7 @@ async function findPort(start = 3000) {
40
47
  while (!(await checkPort(port))) {
41
48
  console.log(`⚠️ Port ${port} in use`);
42
49
  port++;
43
- console.log("⚠️trying port ${port}")
50
+ console.log(`⚠️trying port ${port}`)
44
51
  }
45
52
 
46
53
  return port;
@@ -0,0 +1,3 @@
1
+ <html>
2
+ <pre>No html.</pre>
3
+ </html>
@@ -0,0 +1,2 @@
1
+ <pre>Fill in the content here....</pre>
2
+ <p>....in thin file....</p>