Jeongmin Seo

merge feature/login_signup branch

1 +# Logs
2 +logs
3 +*.log
4 +npm-debug.log*
5 +yarn-debug.log*
6 +yarn-error.log*
7 +lerna-debug.log*
8 +.pnpm-debug.log*
9 +
10 +# Diagnostic reports (https://nodejs.org/api/report.html)
11 +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12 +
13 +# Runtime data
14 +pids
15 +*.pid
16 +*.seed
17 +*.pid.lock
18 +
19 +# Directory for instrumented libs generated by jscoverage/JSCover
20 +lib-cov
21 +
22 +# Coverage directory used by tools like istanbul
23 +coverage
24 +*.lcov
25 +
26 +# nyc test coverage
27 +.nyc_output
28 +
29 +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30 +.grunt
31 +
32 +# Bower dependency directory (https://bower.io/)
33 +bower_components
34 +
35 +# node-waf configuration
36 +.lock-wscript
37 +
38 +# Compiled binary addons (https://nodejs.org/api/addons.html)
39 +build/Release
40 +
41 +# Dependency directories
42 +**node_modules/
43 +jspm_packages/
44 +
45 +# Snowpack dependency directory (https://snowpack.dev/)
46 +web_modules/
47 +
48 +# TypeScript cache
49 +*.tsbuildinfo
50 +
51 +# Optional npm cache directory
52 +.npm
53 +
54 +# Optional eslint cache
55 +.eslintcache
56 +
57 +# Microbundle cache
58 +.rpt2_cache/
59 +.rts2_cache_cjs/
60 +.rts2_cache_es/
61 +.rts2_cache_umd/
62 +
63 +# Optional REPL history
64 +.node_repl_history
65 +
66 +# Output of 'npm pack'
67 +*.tgz
68 +
69 +# Yarn Integrity file
70 +.yarn-integrity
71 +
72 +# dotenv environment variables file
73 +.env
74 +.env.test
75 +.env.production
76 +
77 +# parcel-bundler cache (https://parceljs.org/)
78 +.cache
79 +.parcel-cache
80 +
81 +# Next.js build output
82 +.next
83 +out
84 +
85 +# Nuxt.js build / generate output
86 +.nuxt
87 +dist
88 +
89 +# Gatsby files
90 +.cache/
91 +# Comment in the public line in if your project uses Gatsby and not Next.js
92 +# https://nextjs.org/blog/next-9-1#public-directory-support
93 +# public
94 +
95 +# vuepress build output
96 +.vuepress/dist
97 +
98 +# Serverless directories
99 +.serverless/
100 +
101 +# FuseBox cache
102 +.fusebox/
103 +
104 +# DynamoDB Local files
105 +.dynamodb/
106 +
107 +# TernJS port file
108 +.tern-port
109 +
110 +# Stores VSCode versions used for testing VSCode extensions
111 +.vscode-test
112 +
113 +# yarn v2
114 +.yarn/cache
115 +.yarn/unplugged
116 +.yarn/build-state.yml
117 +.yarn/install-state.gz
118 +.pnp.*
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";
2 +//모듈
3 +const express = require("express");
4 +const bodyParser = require("body-parser");
5 +//환경변수 (운영체제간 gap 없애고자)
6 +const dotenv = require("dotenv");
7 +dotenv.config();
8 +const app = express();
9 +//라우팅
10 +const home = require("./src/routes/home");
11 +// 앱 세팅
12 +app.set("views", "./src/views");
13 +app.set("view engine", "ejs");
14 +app.use(express.static(`${__dirname}/src/public`));
15 +app.use(bodyParser.json());
16 +//url통해 전달되는 데이터에 한글, 공백 등의 문자 오류 해결
17 +app.use(bodyParser.urlencoded({extended: true}));
18 +
19 +app.use("/", home); //미들웨어 등록해주는 method
20 +
21 +module.exports = app;
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";
2 +
3 +const app = require("../app");
4 +const PORT = process.env.PORT || 3000;
5 +
6 +app.listen(PORT, () => {
7 + console.log("서버 가동");
8 +});
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "name": "login",
3 + "version": "1.0.0",
4 + "lockfileVersion": 1,
5 + "requires": true,
6 + "dependencies": {
7 + "accepts": {
8 + "version": "1.3.8",
9 + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
10 + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
11 + "requires": {
12 + "mime-types": "~2.1.34",
13 + "negotiator": "0.6.3"
14 + }
15 + },
16 + "ansi-styles": {
17 + "version": "4.3.0",
18 + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
19 + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
20 + "requires": {
21 + "color-convert": "^2.0.1"
22 + }
23 + },
24 + "array-flatten": {
25 + "version": "1.1.1",
26 + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
27 + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
28 + },
29 + "async": {
30 + "version": "3.2.3",
31 + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz",
32 + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
33 + },
34 + "balanced-match": {
35 + "version": "1.0.2",
36 + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
37 + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
38 + },
39 + "bignumber.js": {
40 + "version": "9.0.0",
41 + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz",
42 + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A=="
43 + },
44 + "body-parser": {
45 + "version": "1.20.0",
46 + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
47 + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
48 + "requires": {
49 + "bytes": "3.1.2",
50 + "content-type": "~1.0.4",
51 + "debug": "2.6.9",
52 + "depd": "2.0.0",
53 + "destroy": "1.2.0",
54 + "http-errors": "2.0.0",
55 + "iconv-lite": "0.4.24",
56 + "on-finished": "2.4.1",
57 + "qs": "6.10.3",
58 + "raw-body": "2.5.1",
59 + "type-is": "~1.6.18",
60 + "unpipe": "1.0.0"
61 + }
62 + },
63 + "brace-expansion": {
64 + "version": "2.0.1",
65 + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
66 + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
67 + "requires": {
68 + "balanced-match": "^1.0.0"
69 + }
70 + },
71 + "bytes": {
72 + "version": "3.1.2",
73 + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
74 + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="
75 + },
76 + "call-bind": {
77 + "version": "1.0.2",
78 + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
79 + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
80 + "requires": {
81 + "function-bind": "^1.1.1",
82 + "get-intrinsic": "^1.0.2"
83 + }
84 + },
85 + "chalk": {
86 + "version": "4.1.2",
87 + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
88 + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
89 + "requires": {
90 + "ansi-styles": "^4.1.0",
91 + "supports-color": "^7.1.0"
92 + }
93 + },
94 + "color-convert": {
95 + "version": "2.0.1",
96 + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
97 + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
98 + "requires": {
99 + "color-name": "~1.1.4"
100 + }
101 + },
102 + "color-name": {
103 + "version": "1.1.4",
104 + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
105 + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
106 + },
107 + "concat-map": {
108 + "version": "0.0.1",
109 + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
110 + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
111 + },
112 + "content-disposition": {
113 + "version": "0.5.4",
114 + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
115 + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
116 + "requires": {
117 + "safe-buffer": "5.2.1"
118 + }
119 + },
120 + "content-type": {
121 + "version": "1.0.4",
122 + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
123 + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
124 + },
125 + "cookie": {
126 + "version": "0.5.0",
127 + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
128 + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw=="
129 + },
130 + "cookie-signature": {
131 + "version": "1.0.6",
132 + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
133 + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
134 + },
135 + "core-util-is": {
136 + "version": "1.0.3",
137 + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
138 + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
139 + },
140 + "debug": {
141 + "version": "2.6.9",
142 + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
143 + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
144 + "requires": {
145 + "ms": "2.0.0"
146 + }
147 + },
148 + "depd": {
149 + "version": "2.0.0",
150 + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
151 + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="
152 + },
153 + "destroy": {
154 + "version": "1.2.0",
155 + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
156 + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="
157 + },
158 + "dotenv": {
159 + "version": "16.0.1",
160 + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
161 + "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ=="
162 + },
163 + "ee-first": {
164 + "version": "1.1.1",
165 + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
166 + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
167 + },
168 + "ejs": {
169 + "version": "3.1.8",
170 + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz",
171 + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==",
172 + "requires": {
173 + "jake": "^10.8.5"
174 + }
175 + },
176 + "encodeurl": {
177 + "version": "1.0.2",
178 + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
179 + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
180 + },
181 + "escape-html": {
182 + "version": "1.0.3",
183 + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
184 + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
185 + },
186 + "etag": {
187 + "version": "1.8.1",
188 + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
189 + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="
190 + },
191 + "express": {
192 + "version": "4.18.1",
193 + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
194 + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
195 + "requires": {
196 + "accepts": "~1.3.8",
197 + "array-flatten": "1.1.1",
198 + "body-parser": "1.20.0",
199 + "content-disposition": "0.5.4",
200 + "content-type": "~1.0.4",
201 + "cookie": "0.5.0",
202 + "cookie-signature": "1.0.6",
203 + "debug": "2.6.9",
204 + "depd": "2.0.0",
205 + "encodeurl": "~1.0.2",
206 + "escape-html": "~1.0.3",
207 + "etag": "~1.8.1",
208 + "finalhandler": "1.2.0",
209 + "fresh": "0.5.2",
210 + "http-errors": "2.0.0",
211 + "merge-descriptors": "1.0.1",
212 + "methods": "~1.1.2",
213 + "on-finished": "2.4.1",
214 + "parseurl": "~1.3.3",
215 + "path-to-regexp": "0.1.7",
216 + "proxy-addr": "~2.0.7",
217 + "qs": "6.10.3",
218 + "range-parser": "~1.2.1",
219 + "safe-buffer": "5.2.1",
220 + "send": "0.18.0",
221 + "serve-static": "1.15.0",
222 + "setprototypeof": "1.2.0",
223 + "statuses": "2.0.1",
224 + "type-is": "~1.6.18",
225 + "utils-merge": "1.0.1",
226 + "vary": "~1.1.2"
227 + }
228 + },
229 + "filelist": {
230 + "version": "1.0.4",
231 + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",
232 + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==",
233 + "requires": {
234 + "minimatch": "^5.0.1"
235 + },
236 + "dependencies": {
237 + "minimatch": {
238 + "version": "5.1.0",
239 + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz",
240 + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==",
241 + "requires": {
242 + "brace-expansion": "^2.0.1"
243 + }
244 + }
245 + }
246 + },
247 + "finalhandler": {
248 + "version": "1.2.0",
249 + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
250 + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
251 + "requires": {
252 + "debug": "2.6.9",
253 + "encodeurl": "~1.0.2",
254 + "escape-html": "~1.0.3",
255 + "on-finished": "2.4.1",
256 + "parseurl": "~1.3.3",
257 + "statuses": "2.0.1",
258 + "unpipe": "~1.0.0"
259 + }
260 + },
261 + "forwarded": {
262 + "version": "0.2.0",
263 + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
264 + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
265 + },
266 + "fresh": {
267 + "version": "0.5.2",
268 + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
269 + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
270 + },
271 + "function-bind": {
272 + "version": "1.1.1",
273 + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
274 + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
275 + },
276 + "get-intrinsic": {
277 + "version": "1.1.1",
278 + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
279 + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
280 + "requires": {
281 + "function-bind": "^1.1.1",
282 + "has": "^1.0.3",
283 + "has-symbols": "^1.0.1"
284 + }
285 + },
286 + "has": {
287 + "version": "1.0.3",
288 + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
289 + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
290 + "requires": {
291 + "function-bind": "^1.1.1"
292 + }
293 + },
294 + "has-flag": {
295 + "version": "4.0.0",
296 + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
297 + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
298 + },
299 + "has-symbols": {
300 + "version": "1.0.3",
301 + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
302 + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
303 + },
304 + "http-errors": {
305 + "version": "2.0.0",
306 + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
307 + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
308 + "requires": {
309 + "depd": "2.0.0",
310 + "inherits": "2.0.4",
311 + "setprototypeof": "1.2.0",
312 + "statuses": "2.0.1",
313 + "toidentifier": "1.0.1"
314 + }
315 + },
316 + "iconv-lite": {
317 + "version": "0.4.24",
318 + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
319 + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
320 + "requires": {
321 + "safer-buffer": ">= 2.1.2 < 3"
322 + }
323 + },
324 + "inherits": {
325 + "version": "2.0.4",
326 + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
327 + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
328 + },
329 + "ipaddr.js": {
330 + "version": "1.9.1",
331 + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
332 + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
333 + },
334 + "isarray": {
335 + "version": "1.0.0",
336 + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
337 + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
338 + },
339 + "jake": {
340 + "version": "10.8.5",
341 + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz",
342 + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==",
343 + "requires": {
344 + "async": "^3.2.3",
345 + "chalk": "^4.0.2",
346 + "filelist": "^1.0.1",
347 + "minimatch": "^3.0.4"
348 + }
349 + },
350 + "media-typer": {
351 + "version": "0.3.0",
352 + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
353 + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
354 + },
355 + "merge-descriptors": {
356 + "version": "1.0.1",
357 + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
358 + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
359 + },
360 + "methods": {
361 + "version": "1.1.2",
362 + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
363 + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
364 + },
365 + "mime": {
366 + "version": "1.6.0",
367 + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
368 + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
369 + },
370 + "mime-db": {
371 + "version": "1.52.0",
372 + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
373 + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
374 + },
375 + "mime-types": {
376 + "version": "2.1.35",
377 + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
378 + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
379 + "requires": {
380 + "mime-db": "1.52.0"
381 + }
382 + },
383 + "minimatch": {
384 + "version": "3.1.2",
385 + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
386 + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
387 + "requires": {
388 + "brace-expansion": "^1.1.7"
389 + },
390 + "dependencies": {
391 + "brace-expansion": {
392 + "version": "1.1.11",
393 + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
394 + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
395 + "requires": {
396 + "balanced-match": "^1.0.0",
397 + "concat-map": "0.0.1"
398 + }
399 + }
400 + }
401 + },
402 + "ms": {
403 + "version": "2.0.0",
404 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
405 + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
406 + },
407 + "mysql": {
408 + "version": "2.18.1",
409 + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz",
410 + "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==",
411 + "requires": {
412 + "bignumber.js": "9.0.0",
413 + "readable-stream": "2.3.7",
414 + "safe-buffer": "5.1.2",
415 + "sqlstring": "2.3.1"
416 + },
417 + "dependencies": {
418 + "safe-buffer": {
419 + "version": "5.1.2",
420 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
421 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
422 + }
423 + }
424 + },
425 + "negotiator": {
426 + "version": "0.6.3",
427 + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
428 + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
429 + },
430 + "object-inspect": {
431 + "version": "1.12.2",
432 + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
433 + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ=="
434 + },
435 + "on-finished": {
436 + "version": "2.4.1",
437 + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
438 + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
439 + "requires": {
440 + "ee-first": "1.1.1"
441 + }
442 + },
443 + "parseurl": {
444 + "version": "1.3.3",
445 + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
446 + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
447 + },
448 + "path-to-regexp": {
449 + "version": "0.1.7",
450 + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
451 + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
452 + },
453 + "process-nextick-args": {
454 + "version": "2.0.1",
455 + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
456 + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
457 + },
458 + "proxy-addr": {
459 + "version": "2.0.7",
460 + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
461 + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
462 + "requires": {
463 + "forwarded": "0.2.0",
464 + "ipaddr.js": "1.9.1"
465 + }
466 + },
467 + "qs": {
468 + "version": "6.10.3",
469 + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
470 + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
471 + "requires": {
472 + "side-channel": "^1.0.4"
473 + }
474 + },
475 + "range-parser": {
476 + "version": "1.2.1",
477 + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
478 + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
479 + },
480 + "raw-body": {
481 + "version": "2.5.1",
482 + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
483 + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
484 + "requires": {
485 + "bytes": "3.1.2",
486 + "http-errors": "2.0.0",
487 + "iconv-lite": "0.4.24",
488 + "unpipe": "1.0.0"
489 + }
490 + },
491 + "readable-stream": {
492 + "version": "2.3.7",
493 + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
494 + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
495 + "requires": {
496 + "core-util-is": "~1.0.0",
497 + "inherits": "~2.0.3",
498 + "isarray": "~1.0.0",
499 + "process-nextick-args": "~2.0.0",
500 + "safe-buffer": "~5.1.1",
501 + "string_decoder": "~1.1.1",
502 + "util-deprecate": "~1.0.1"
503 + },
504 + "dependencies": {
505 + "safe-buffer": {
506 + "version": "5.1.2",
507 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
508 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
509 + }
510 + }
511 + },
512 + "safe-buffer": {
513 + "version": "5.2.1",
514 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
515 + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
516 + },
517 + "safer-buffer": {
518 + "version": "2.1.2",
519 + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
520 + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
521 + },
522 + "send": {
523 + "version": "0.18.0",
524 + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
525 + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
526 + "requires": {
527 + "debug": "2.6.9",
528 + "depd": "2.0.0",
529 + "destroy": "1.2.0",
530 + "encodeurl": "~1.0.2",
531 + "escape-html": "~1.0.3",
532 + "etag": "~1.8.1",
533 + "fresh": "0.5.2",
534 + "http-errors": "2.0.0",
535 + "mime": "1.6.0",
536 + "ms": "2.1.3",
537 + "on-finished": "2.4.1",
538 + "range-parser": "~1.2.1",
539 + "statuses": "2.0.1"
540 + },
541 + "dependencies": {
542 + "ms": {
543 + "version": "2.1.3",
544 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
545 + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
546 + }
547 + }
548 + },
549 + "serve-static": {
550 + "version": "1.15.0",
551 + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
552 + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
553 + "requires": {
554 + "encodeurl": "~1.0.2",
555 + "escape-html": "~1.0.3",
556 + "parseurl": "~1.3.3",
557 + "send": "0.18.0"
558 + }
559 + },
560 + "setprototypeof": {
561 + "version": "1.2.0",
562 + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
563 + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
564 + },
565 + "side-channel": {
566 + "version": "1.0.4",
567 + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
568 + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
569 + "requires": {
570 + "call-bind": "^1.0.0",
571 + "get-intrinsic": "^1.0.2",
572 + "object-inspect": "^1.9.0"
573 + }
574 + },
575 + "sqlstring": {
576 + "version": "2.3.1",
577 + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz",
578 + "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A="
579 + },
580 + "statuses": {
581 + "version": "2.0.1",
582 + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
583 + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
584 + },
585 + "string_decoder": {
586 + "version": "1.1.1",
587 + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
588 + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
589 + "requires": {
590 + "safe-buffer": "~5.1.0"
591 + },
592 + "dependencies": {
593 + "safe-buffer": {
594 + "version": "5.1.2",
595 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
596 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
597 + }
598 + }
599 + },
600 + "supports-color": {
601 + "version": "7.2.0",
602 + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
603 + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
604 + "requires": {
605 + "has-flag": "^4.0.0"
606 + }
607 + },
608 + "toidentifier": {
609 + "version": "1.0.1",
610 + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
611 + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
612 + },
613 + "type-is": {
614 + "version": "1.6.18",
615 + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
616 + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
617 + "requires": {
618 + "media-typer": "0.3.0",
619 + "mime-types": "~2.1.24"
620 + }
621 + },
622 + "unpipe": {
623 + "version": "1.0.0",
624 + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
625 + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
626 + },
627 + "util-deprecate": {
628 + "version": "1.0.2",
629 + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
630 + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
631 + },
632 + "utils-merge": {
633 + "version": "1.0.1",
634 + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
635 + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
636 + },
637 + "vary": {
638 + "version": "1.1.2",
639 + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
640 + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
641 + }
642 + }
643 +}
1 +{
2 + "name": "login",
3 + "version": "1.0.0",
4 + "main": "app.js",
5 + "bin": {
6 + "login": "www.js"
7 + },
8 + "dependencies": {
9 + "body-parser": "^1.20.0",
10 + "dotenv": "^16.0.1",
11 + "ejs": "^3.1.8",
12 + "express": "^4.18.1",
13 + "mysql": "^2.18.1"
14 + },
15 + "devDependencies": {},
16 + "scripts": {
17 + "start": "nodemon ./bin/www.js",
18 + "test": "echo \"Error: no test specified\" && exit 1"
19 + },
20 + "author": "",
21 + "license": "ISC",
22 + "keywords": [],
23 + "description": ""
24 +}
1 +const mysql = require("mysql");
2 +
3 +const db = mysql.createConnection({
4 + host: process.env.DB_HOST,
5 + user: process.env.DB_USER,
6 + password: process.env.DB_PASSWORD,
7 + database: process.env.DB_DATABASE,
8 +});
9 +
10 +db.connect();
11 +
12 +module.exports = db;
...\ No newline at end of file ...\ No newline at end of file
1 +'use strict';
2 +//for DB manipulate
3 +const UserStorage = require("./UserStorage");
4 +
5 +class User {
6 + constructor(body) {
7 + this.body = body;
8 + }
9 +
10 + async login() {
11 + const client = this.body;
12 + try {
13 +
14 + const {id, password} = await UserStorage.getUserInfo(client.id);
15 + // console.log(id, password);
16 +
17 + if (id) {
18 + if (id === client.id && password === client.password) {
19 + return { success: true};
20 + }
21 + return { success : false, msg: "비밀번호가 틀렸습니다."};
22 + }
23 + return {success: false, msg: "존재하지 않는 아이디입니다."};
24 + } catch (err) {
25 + return {success: false, msg: err};
26 + }
27 + }
28 +
29 + async register() {
30 + const client = this.body;
31 + try {
32 + const response = await UserStorage.save(client);
33 + // console.log(response);
34 + return response;
35 + } catch (err) {
36 +
37 + return {success: false, msg : err};
38 + }
39 + }
40 +}
41 +
42 +module.exports = User;
...\ No newline at end of file ...\ No newline at end of file
1 +'use strict';
2 +//for DB CRUD
3 +const db = require("../config/db");
4 +
5 +
6 +class UserStorage {
7 + // static getUsers(isAll, ...fields) {
8 + // }
9 +
10 + static getUserInfo(id) {
11 + return new Promise((resolve, reject) => {
12 + const query = "SELECT * FROM users WHERE id = ?;";
13 + db.query(query, [id], (err, data) => {
14 + if (err) reject(`${err}`);
15 + // console.log(data[0]);
16 + resolve(data[0]);
17 + });
18 + });
19 + }
20 +
21 + static async save(userInfo) {
22 + return new Promise((resolve, reject) => {
23 + const query = "INSERT INTO users(id, name, password) VALUES(?, ?, ?);";
24 + db.query(
25 + query,
26 + [userInfo.id, userInfo.name, userInfo.password],
27 + (err, data) => {
28 + if (err) reject(`${err}`);
29 + // console.log(data[0]);
30 + resolve({ success: true});
31 + }
32 + );
33 + });
34 + }
35 +}
36 +
37 +module.exports = UserStorage;
...\ No newline at end of file ...\ No newline at end of file
1 +@import url(https://fonts.googleapis.com/css?family=Roboto:300);
2 +
3 +.login-page {
4 + width: 360px;
5 + padding: 12% 0 0;
6 + margin: auto;
7 +}
8 +.form {
9 + position: relative;
10 + z-index: 1;
11 + background: #FFFFFF;
12 + max-width: 360px;
13 + margin: 0 auto 100px;
14 + padding: 45px;
15 + text-align: center;
16 + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
17 +}
18 +.form input {
19 + font-family: "Roboto", sans-serif;
20 + outline: 0;
21 + background: #f2f2f2;
22 + width: 100%;
23 + border: 0;
24 + margin: 0 0 15px;
25 + padding: 15px;
26 + box-sizing: border-box;
27 + font-size: 14px;
28 +}
29 +.form #button {
30 + font-family: "Roboto", sans-serif;
31 + text-transform: uppercase;
32 + outline: 0;
33 + background: rebeccapurple;
34 + width: 89%;
35 + border: 0;
36 + margin: 0 auto;
37 + padding: 15px;
38 + color: #FFFFFF;
39 + font-size: 14px;
40 + -webkit-transition: all 0.3 ease;
41 + transition: all 0.3 ease;
42 + cursor: pointer;
43 +}
44 +.form #button:hover,.form #button:active,.form #button:focus {
45 + background: rebeccapurple;
46 +}
47 +.form .message {
48 + margin: 15px 0 0;
49 + color: #b3b3b3;
50 + font-size: 12px;
51 +}
52 +.form .message a {
53 + color: rebeccapurple;
54 + text-decoration: none;
55 +}
56 +.form .register-form {
57 + display: none;
58 +}
59 +.container {
60 + position: relative;
61 + z-index: 1;
62 + max-width: 300px;
63 + margin: 0 auto;
64 +}
65 +.container:before, .container:after {
66 + content: "";
67 + display: block;
68 + clear: both;
69 +}
70 +.container .info {
71 + margin: 50px auto;
72 + text-align: center;
73 +}
74 +.container .info h1 {
75 + margin: 0 0 15px;
76 + padding: 0;
77 + font-size: 36px;
78 + font-weight: 300;
79 + color: #1a1a1a;
80 +}
81 +.container .info span {
82 + color: #4d4d4d;
83 + font-size: 12px;
84 +}
85 +.container .info span a {
86 + color: #000000;
87 + text-decoration: none;
88 +}
89 +.container .info span .fa {
90 + color: #EF3B3A;
91 +}
92 +
93 +/* #id::placeholder #password::placeholder {
94 + color: black;
95 + font-style: italic;
96 + font-weight: bold;
97 +} */
98 +
99 +body {
100 + background: rebeccapurple; /* fallback for old browsers */
101 + /* background: rebeccapurple; */
102 + background: linear-gradient(90deg, rebeccapurple 0%, rebeccapurple 0%);
103 + font-family: "Roboto", sans-serif;
104 + -webkit-font-smoothing: antialiased;
105 + -moz-osx-font-smoothing: grayscale;
106 +}
107 +
108 +/* Copyright (c) 2022 by Aigars Silkalns (https://codepen.io/colorlib/pen/rxddKy) */
...\ No newline at end of file ...\ No newline at end of file
1 +@import url(https://fonts.googleapis.com/css?family=Roboto:300);
2 +
3 +.login-page {
4 + width: 360px;
5 + padding: 8% 0 0;
6 + margin: auto;
7 +}
8 +.form {
9 + position: relative;
10 + z-index: 1;
11 + background: #FFFFFF;
12 + max-width: 360px;
13 + margin: 0 auto 100px;
14 + padding: 45px;
15 + text-align: center;
16 + box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
17 +}
18 +.form input {
19 + font-family: "Roboto", sans-serif;
20 + outline: 0;
21 + background: #f2f2f2;
22 + width: 100%;
23 + border: 0;
24 + margin: 0 0 15px;
25 + padding: 15px;
26 + box-sizing: border-box;
27 + font-size: 14px;
28 +}
29 +.form #button {
30 + font-family: "Roboto", sans-serif;
31 + text-transform: uppercase;
32 + outline: 0;
33 + background: rebeccapurple;
34 + width: 89%;
35 + border: 0;
36 + margin: 0 auto;
37 + padding: 15px;
38 + color: #FFFFFF;
39 + font-size: 14px;
40 + -webkit-transition: all 0.3 ease;
41 + transition: all 0.3 ease;
42 + cursor: pointer;
43 +}
44 +.form #button:hover,.form #button:active,.form #button:focus {
45 + background: rebeccapurple;
46 +}
47 +.form .message {
48 + margin: 15px 0 0;
49 + color: #b3b3b3;
50 + font-size: 12px;
51 +}
52 +.form .message a {
53 + color: rebeccapurple;
54 + text-decoration: none;
55 +}
56 +.form .register-form {
57 + display: none;
58 +}
59 +.container {
60 + position: relative;
61 + z-index: 1;
62 + max-width: 300px;
63 + margin: 0 auto;
64 +}
65 +.container:before, .container:after {
66 + content: "";
67 + display: block;
68 + clear: both;
69 +}
70 +.container .info {
71 + margin: 50px auto;
72 + text-align: center;
73 +}
74 +.container .info h1 {
75 + margin: 0 0 15px;
76 + padding: 0;
77 + font-size: 36px;
78 + font-weight: 300;
79 + color: #1a1a1a;
80 +}
81 +.container .info span {
82 + color: #4d4d4d;
83 + font-size: 12px;
84 +}
85 +.container .info span a {
86 + color: #000000;
87 + text-decoration: none;
88 +}
89 +.container .info span .fa {
90 + color: #EF3B3A;
91 +}
92 +
93 +/* #id::placeholder #password::placeholder {
94 + color: black;
95 + font-style: italic;
96 + font-weight: bold;
97 +} */
98 +
99 +body {
100 + background: rebeccapurple; /* fallback for old browsers */
101 + /* background: rebeccapurple; */
102 + background: linear-gradient(90deg, rebeccapurple 0%, rebeccapurple 0%);
103 + font-family: "Roboto", sans-serif;
104 + -webkit-font-smoothing: antialiased;
105 + -moz-osx-font-smoothing: grayscale;
106 +}
107 +
108 +/* Copyright (c) 2022 by Aigars Silkalns (https://codepen.io/colorlib/pen/rxddKy) */
...\ No newline at end of file ...\ No newline at end of file
1 +'use strict';
2 +
3 +const id = document.querySelector("#id"),
4 + password = document.querySelector("#password"),
5 + loginBtn = document.querySelector("#button");
6 +
7 +loginBtn.addEventListener("click", login);
8 +
9 +function login() {
10 + const req = {
11 + id : id.value,
12 + password : password.value,
13 + };
14 +
15 + fetch("/login", {
16 + method: "POST",
17 + headers: {
18 + "Content-Type": "application/json"
19 + },
20 + body: JSON.stringify(req),
21 + })
22 + .then((res) => res.json())
23 + .then((res) => {
24 + if (res.success) {
25 + //성공하면 이동
26 + location.href = "/";
27 + } else {
28 + alert(res.msg);
29 + }
30 + })
31 + .catch((err) => {
32 + console.error("로그인 중 에러 발생");
33 + });
34 +}
...\ No newline at end of file ...\ No newline at end of file
1 +'use strict';
2 +
3 +const id = document.querySelector("#id"),
4 + name = document.querySelector("#name"),
5 + password = document.querySelector("#password"),
6 + confirmPassword = document.querySelector("#confirm-password"),
7 + registerBtn = document.querySelector("#button");
8 +
9 +registerBtn.addEventListener("click", register);
10 +
11 +function register() {
12 + if(!id.value) {
13 + return alert("아이디를 입력해주세요.")
14 + }
15 +
16 + if(!name.value) {
17 + return alert("이름을 입력해주세요.")
18 + }
19 + if(!password.value) {
20 + return alert("비밀번호를 입력해주세요.")
21 + }
22 + if(!confirmPassword.value) {
23 + return alert("비밀번호를 확인해주세요.")
24 + }
25 + if (password.value !== confirmPassword.value) {
26 + return alert("비밀번호가 일치하지 않습니다.")
27 + }
28 +
29 + const req = {
30 + id : id.value,
31 + name : name.value,
32 + password : password.value,
33 + };
34 +
35 + fetch("/register", {
36 + method: "POST",
37 + headers: {
38 + "Content-Type": "application/json"
39 + },
40 + body: JSON.stringify(req),
41 + })
42 + .then((res) => res.json())
43 + .then((res) => {
44 + if (res.success) {
45 + //성공하면 이동
46 + location.href = "/login";
47 + } else {
48 + alert(res.msg);
49 + }
50 + })
51 + .catch((err) => {
52 + console.error("회원가입 중 에러 발생");
53 + });
54 +}
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";
2 +
3 +const User = require("../../models/User");
4 +
5 +const output = {
6 + hello: (req, res) => {
7 + res.render("home/index");
8 + },
9 +
10 + login: (req, res) => {
11 + res.render("home/login");
12 + },
13 +
14 + register: (req, res) => {
15 + res.render("home/register");
16 + }
17 +};
18 +
19 +const process = {
20 + login: async (req, res) => {
21 + const user = new User(req.body);
22 + const response = await user.login();
23 + return res.json(response);
24 + },
25 +
26 + register: async (req, res) => {
27 + const user = new User(req.body);
28 + const response = await user.register();
29 + return res.json(response);
30 + },
31 + // const id = req.body.id,
32 + // password = req.body.password;
33 + // const users = UserStorage.getUsers("id", "password");
34 + // // console.log(UserStorage.getUsers("id", "password","name"));
35 + // const response = {};
36 +
37 + // if (users.id.includes(id)) {
38 + // const idx = users.id.indexOf(id);
39 + // if (users.password[idx] === password) {
40 + // response.success = true;
41 + // return res.json(response);
42 + // }
43 + // }
44 +
45 + // response.success = false;
46 + // response.msg = "로그인에 실패하였습니다."
47 + // return res.json(response);
48 +};
49 +
50 +module.exports = {
51 + output,
52 + process,
53 +};
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";
2 +
3 +const express = require("express");
4 +const router = express.Router();
5 +
6 +const ctrl = require("./home.ctrl");
7 +
8 +router.get("/", ctrl.output.hello);
9 +router.get("/login", ctrl.output.login);
10 +router.get("/register", ctrl.output.register);
11 +
12 +router.post("/login", ctrl.process.login);
13 +router.post("/register", ctrl.process.register);
14 +
15 +module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
1 +<!DOCTYPE html>
2 +<html lang="ko">
3 + <head>
4 + <meta charset="UTF-8" />
5 + <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 + <title>Document</title>
8 + </head>
9 + <body>
10 + 여기는 루트입니다.
11 + </body>
12 +</html>
1 +<!DOCTYPE html>
2 +<html lang="ko">
3 + <head>
4 + <meta charset="UTF-8" />
5 + <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 + <link rel="stylesheet" href="/css/home/login.css" />
8 + <script src="/js/home/login.js" defer></script>
9 + <title>Document</title>
10 + </head>
11 + <body>
12 + <div class="login-page">
13 + <div class="form">
14 + <!-- <form class="register-form">
15 + <input type="text" placeholder="name" />
16 + <input type="password" placeholder="password" />
17 + <input type="text" placeholder="email address" />
18 + <button>create</button>
19 + <p class="message">Already registered? <a href="#">Sign In</a></p>
20 + </form> -->
21 + <form class="login-form">
22 + <input id="id" type="text" placeholder="아이디" />
23 + <input id="password" type="password" placeholder="비밀번호" />
24 + <p id="button">LOGIN</p>
25 + <p class="message">
26 + 계정이 없으신가요? <a href="/register">회원가입</a>
27 + </p>
28 + </form>
29 + </div>
30 + </div>
31 + </body>
32 +</html>
33 +
34 +<!-- Copyright (c) 2022 by Aigars Silkalns (https://codepen.io/colorlib/pen/rxddKy) -->
1 +<!DOCTYPE html>
2 +<html lang="ko">
3 + <head>
4 + <meta charset="UTF-8" />
5 + <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 + <link rel="stylesheet" href="/css/home/register.css" />
8 + <script src="/js/home/register.js" defer></script>
9 + <title>Document</title>
10 + </head>
11 + <body>
12 + <div class="login-page">
13 + <div class="form">
14 + <!-- <form class="register-form">
15 + <input type="text" placeholder="name" />
16 + <input type="password" placeholder="password" />
17 + <input type="text" placeholder="email address" />
18 + <button>create</button>
19 + <p class="message">Already registered? <a href="#">Sign In</a></p>
20 + </form> -->
21 + <form class="login-form">
22 + <input id="id" type="text" placeholder="아이디" />
23 + <input id="name" type="text" placeholder="이름" />
24 + <input id="password" type="password" placeholder="비밀번호" />
25 + <input
26 + id="confirm-password"
27 + type="password"
28 + placeholder="비밀번호 확인"
29 + />
30 + <p id="button">SIGN UP</p>
31 + <p class="message">계정이 있으신가요? <a href="/login">로그인</a></p>
32 + </form>
33 + </div>
34 + </div>
35 + </body>
36 +</html>
37 +
38 +<!-- Copyright (c) 2022 by Aigars Silkalns (https://codepen.io/colorlib/pen/rxddKy) -->
1 +{
2 + "lockfileVersion": 1
3 +}