일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- java.sql.SQLRecoverableException
- was버그
- 디미터 법칙
- 명령어공부
- OpenAPI
- Bandit Level 6
- springboot
- SQLRecoverableException
- avax.net.ssl.SSLHandshakeException:
- pl/sql
- 스크럼기법
- Bandit Level 6 → Level 7
- 시스템 파악
- 시스템 파악 정리
- was SQLRecoverableException
- 폭포수 모형
- vue
- table scan
- 클린코드
- plsql
- Bandit Level 5
- 인증서만료에러
- 프로토타입 모형
- mysql 튜닝
- 에자일 모형
- 나선형 모형
- 변수명 짓는법
- 커맨드공부
- CSS
- Law of Demeter
- Today
- Total
목록개발/node.js (8)
개발햄비
const data \= new Uint8Array(Buffer.from('Hello Node.js')); fs.writeFile('message.txt', data, (err) \=> { if (err) throw err; console.log('The file has been saved!'); }); create if (pathname === '/create') { fs.readdir('./data',function( error,filelist){ var templat = makeInfo('Web - create',filelist,\` \`); // 200은 성공했다는 의미 response.writeHead(200)..
module.exports 안에 tamplat을 넣고 선언 후 module.exports = { html : function(tatle,list,body,data){ return \` Web ${list} ${data} ${body} \`; },list :function(filelist){ var list = ''; var i = 0 while (i< filelist.length) { list = list + \`${filelist\[i\]}\`; i= i + 1; } list = list + ''; return list } }부르고자 하는 js파일에 들어간다 (참고로 현재 디렉토리 / lib / templat.,js을 만들었다) var templat = require(..
fs.readFile('/etc/passwd', (err, data) => { if (err) throw err; console.log(data); }); var http = require('http'); var fs = require('fs'); var url = require('url'); var qs = require('querystring') function templatHTML(tatle,list,body,data){ return \` WEB1 - ${tatle} # [Web](/) ${list} ${data} ${body} \`; } function makeFlieList(filelist){ var list = ' ..
1.heroku 서버 셋팅 https://dashboard.heroku.com/ 원하는 사이트 이름을 지정해줍니다 2. 프로젝트 생성. 환경 : node.js 설치 필수 $ sudo npm install npm -g $ npm init $ npm install express request body-parser --save npm init를 실행하시면 다음과 같이 나옵니다. ihanbiui-MacBookPro:botProject ihanbi$ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults...
https://github.com/leehanbi/nodeStudy/ lib/author.jslib/topic.jslib/db.js참고 main.js Executable File 56 lines (55 sloc) 1.85 KBvar http = require('http');var url = require('url');var topic = require('./lib/topic.js');var author = require('./lib/author.js'); var app = http.createServer(function(request,response){ var _url = request.url; // queryData를 통해서 전송한 값을 받을 수 있음 var queryData = url.parse(_u..
홈페이지에서 댓글이나 게시물을 작성할 때 사용자가 라는 식으로 스크립트 태그를 넣을 수 있다이렇게 되면 작성된 스크립트 태그에 의해서 alert가 작동되게 되는데 이걸 이용하여유저의 정보를 빼가거나 , 링크를 걸어 악의적으로 홈페이지 이동을 만들 수 있다 이 때 방법은 2가지가 있다1. 하나는 script 태그를 완전히 지우는 방법과2. 또 다른 하나는 태그를 entity code로 전환해주는 것이다. 같이 변환시켜 주면 스크립트가 적용되지 않고 그대로 본문에가 출력되는 것을 볼 수 있다. 참고자료 ResultDescriptionEntity NameEntity Numbernon-breaking space greater than>>&ersand&&"double quotation mark""'s..
fs.rename('/tmp/hello', '/tmp/world', (err) => { if (err) throw err; console.log('renamed complete'); }); fs.stat('/tmp/world', (err, stats) => { if (err) throw err; console.log(`stats: ${JSON.stringify(stats)}`); }); if (pathname === '/update'){ fs.readdir('./data',function( error, filelist){ fs.readFile(`data/${queryData.id}`,'utf8',function(err,description){ console.log(description); var tatl..
// Assuming that 'path/file.txt' is a regular file. fs.unlink('path/file.txt', (err) => { if (err) throw err; console.log('path/file.txt was deleted'); });var fs = require('fs'); if (pathname === '/delete_process') { var body = ''; // requst data를 통해서 데이터가 들어와 body에 저장 request.on('data',function(data){ body += data; }); // 그 후 end`로 넘어와 post에 담아서 뽑아 쓸수 있다 request.on('end',function(){ // post에 bo..