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 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
- // 기본 GET
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",
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
@@ -10,3 +10,9 @@
10
10
  - 1.1.3
11
11
  - Fix security issues
12
12
  - delete package koa
13
+ - 1.1.4
14
+ - Fix security issues
15
+ - delted package node-fetch,formdata-polyfill,fetch-blob
16
+ - 1.1.5
17
+ - Edit readme.md
18
+ - New sample code
@@ -1,11 +1,24 @@
1
- const express = require("express");
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.get("/",(req,res)=>{
6
- res.send("server running");
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
- app.listen(3000,()=>{
10
- console.log("server started on 3000");
21
+ // server start
22
+ app.listen(PORT, () => {
23
+ console.log(`Server running on http://localhost:${PORT}`);
11
24
  });