타입스크립트 셋팅(set-up)
2021. 9. 29. 21:36
Backend 언어 및 프레임워크/Javascript- Node, express, Nest
셋팅 순서 npm init -y "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start":"node index.js", "prestart":"tsc" }, tocuh tsconfig.json { "compilerOptions": { "module":"CommonJS", "target":"ES2015", "sourceMap": true }, "include":[ "index.ts" ], "exclude":[ "node_modules" ], } touch index.ts yarn add tsc-watch --dev "scripts": { "start":"tsc-watch --onSuccess \" node dist/index.js..
tsc watch 쓸때 Cannot find module 'typescript/bin/tsc'
2021. 9. 29. 21:34
Backend 언어 및 프레임워크/Javascript- Node, express, Nest
$ npm i -D @types/node typescript ts-node 출처: https://velog.io/@poew/tsc-watch-onSuccess-node-distindex.jsCannot-find-module-typescriptbintscerror-Command-failed-with-exit-code-9
쿠키(cookie) 사용법 (불러오기 ,저장 등)
2021. 9. 17. 12:14
Backend 언어 및 프레임워크/Javascript- Node, express, Nest
쿠키값 보기 cookie-parser npm install cookie-parser 추가 사항 var cookieParser = require('cookie-parser') app.use(cookieParser()) 확인 const cookie = req.cookies console.log(cookie) 쿠키값 저장 res.cookie('test','test-cookie") 활용 예시 app.get('/session', async function (req, res) { gong_id = req.session.userinfo.gong_id res.cookie('gong_id',gong_id) var sess = req.session; res.json(sess); }); app.get('/cookie', a..
노드 디버깅
2021. 8. 25. 11:44
Backend 언어 및 프레임워크/Javascript- Node, express, Nest
—inspect Eng —검사 {"mean":["점검\n \t\t\t點檢 check, inspection, examination, check, inspect, examine","사열\n \t\t\t査閱 [동사] inspect, review","검사1\n \t\t\t檢査 [명사] examination, inspection, test, check; (의료상의) checkup, [동사] examine, inspect, test, check (out)","시찰\n \t\t\t視察 inspection, inspect, make an inspection (of)","감찰\n \t\t\t監察 [명사] inspection, [동사] inspect","inspect [동사]\n\t\t ~ sth/sb (for sth)\..