server-up-ndot 1.1.4 → 1.1.6
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/index.js +3 -3
- package/package.json +1 -1
- package/readme.md +10 -0
- package/templates/basic/app.js +18 -5
package/index.js
CHANGED
|
@@ -30,17 +30,17 @@ const PORT = process.env.PORT || 3000;
|
|
|
30
30
|
app.use(cors());
|
|
31
31
|
app.use(express.json());
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// GET
|
|
34
34
|
app.get('/', (req, res) => {
|
|
35
35
|
res.send('segfaultandsegmentationfault');
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
// POST
|
|
38
|
+
// POST
|
|
39
39
|
app.post('/api', (req, res) => {
|
|
40
40
|
res.json({ received: req.body });
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
//
|
|
43
|
+
// server start
|
|
44
44
|
app.listen(PORT, () => {
|
|
45
45
|
console.log(`Server running on http://localhost:${PORT}`);
|
|
46
46
|
});
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# use
|
|
2
|
+
install server package
|
|
3
|
+
`npm i server-up-ndot`
|
|
4
|
+
install server file
|
|
5
|
+
`npx server-up-ndot create <project-folder>`
|
|
1
6
|
# patch note
|
|
2
7
|
|
|
3
8
|
## 1.1.x
|
|
@@ -13,3 +18,8 @@
|
|
|
13
18
|
- 1.1.4
|
|
14
19
|
- Fix security issues
|
|
15
20
|
- delted package node-fetch,formdata-polyfill,fetch-blob
|
|
21
|
+
- 1.1.5
|
|
22
|
+
- Edit readme.md
|
|
23
|
+
- New sample code
|
|
24
|
+
- 1.1.6
|
|
25
|
+
- **real** edit readme.md(* ̄∇ ̄)ノ
|
package/templates/basic/app.js
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
const express = require(
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const cors = require('cors');
|
|
3
|
+
require('dotenv').config();
|
|
2
4
|
|
|
3
5
|
const app = express();
|
|
6
|
+
const PORT = process.env.PORT || 3000;
|
|
4
7
|
|
|
5
|
-
app.
|
|
6
|
-
|
|
8
|
+
app.use(cors());
|
|
9
|
+
app.use(express.json());
|
|
10
|
+
|
|
11
|
+
// GET
|
|
12
|
+
app.get('/', (req, res) => {
|
|
13
|
+
res.send('segfaultandsegmentationfault');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// POST
|
|
17
|
+
app.post('/api', (req, res) => {
|
|
18
|
+
res.json({ received: req.body });
|
|
7
19
|
});
|
|
8
20
|
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
// server start
|
|
22
|
+
app.listen(PORT, () => {
|
|
23
|
+
console.log(`Server running on http://localhost:${PORT}`);
|
|
11
24
|
});
|