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 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.4",
3
+ "version": "1.1.6",
4
4
  "description": "server toolkit",
5
5
  "main": "index.js",
6
6
  "bin": {
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(* ̄∇ ̄)ノ
@@ -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
  });