server-up-ndot 1.1.3 → 1.1.5
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 -2
- package/readme.md +6 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "server-up-ndot",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "server toolkit",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"morgan": "*",
|
|
40
40
|
"multer": "*",
|
|
41
41
|
"mysql": "*",
|
|
42
|
-
"node-fetch": "*",
|
|
43
42
|
"nodemailer": "*",
|
|
44
43
|
"ora": "*",
|
|
45
44
|
"pg": "*",
|
package/readme.md
CHANGED
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
|
});
|