본문 바로가기

반응형

전체 글

(312)
[XE] 서버이전시 XE설치경로가 변경되어 이미지가 엑박 뜰때 DB에 쿼리를 아래와 같이 날려주면 된다. update xe_documents set content=Replace(content,'http://www.abc.com/files/attach/images', 'http://www.abc.com/xe/files/attach/images') ; 이전 주소에서는 xe 란 폴더가 없었는데, 이전한 곳에서는 xe 폴더 안에다가 xe를 넣은것이 차이점이다.
정규식 정리 - 어떠한 형식에 맞춰 일치하는 결과를 가지고 올 수 있는 것 가끔 정규식을 분석해야 할 때가 있다. 그래서 한번 정리해 보았다. 정규식에 사용되는 기호 ^ (caret) 문장의 시작 $ (dollar) 문장의 끝 . (period) 줄바꿈 또는 단일문자 ex) h.t => hat, hothit, hut, h7t. 등 검출 [] (bracket) 문자의 집합이나 범위를 나타냄, 두 문자 사이에 – 는 범위를 나타냄 {} (braced) {} 내의 숫자는 직전의 선행 문자 수를 나타냄 * (asterisk) 직전의 선행문자가 0번 또는 그이상 나타냄 + (asterisk) 직전의 선행문자가 1번 이상 나타냄 ? (asterisk) 직전의 선행문자가 0번 또는 1번 나타냄 | (bar) or 을 나타냄 \ ..
[node.js] socket set() get() depracated! (socket.io) 기존의 get() set() 은 없어졌고, socket object 에다가 직접 넣어서 쓰면 된다. var http = require('http');var socketio = require('socket.io'); var server = http.createServer();var io = socketio.listen(server);io.sockets.on('connection', function(socket){//기존에 io.set('name') 이랫던거를... socket.on('setname', function(data){socket.name = data;});});
[node.js] How to use layout.ejs in Express 4
[node.js] How to get POST a query in Express.js/Node.js?
[node.js] How to access the GET parameters in Express.js or Node.js? /?parameter="test" 기존 request.param("parameter") 에서... 아래와 같이 업데이트됨; var app = express(); app.post 일때, request.body.parameter app.get 일때, request.params.parameter 어떤 방식으로 값이 들어오는지 보려면 console.log(request.params); console.log(request.body); console.log(request.query); 를 찍어보자.. 또한 app.use(bodyParser.urlencoded({ extended: true })); bodyParser 가 urlencoded 로 되어 있어야된다. JSON으로 되있을 경우 JSON 형식만 읽어오기떄문에..
[node.js] Most middleware (like logger) is no longer bundled with Express and must be installed separately... 『모던 웹을 위한 Node.js 프로그래밍』보면서 차근히 따라하고 있는데.. express에서 미들웨어 사용하다가 난관에 부딪혔다. logger 쓰려고 했더니, 에러가 빡!! 미들웨어가 더이상 번들로 설치되어 있는 게 아니니 따로 설치하란다. 이게 뭔...? 또다시 구글링... 구글링구글구긆릉르르르ㅏ르르르르 http://stackoverflow.com/questions/23526356/heroku-node-js-server-crash-with-error-most-middleware-like-logger-is-no-lo ↑ 이 사람 글을 보니, 2가지 방법이 있댄다. logger 대신에 morgan을 설치해서 사용하든가, express가 설치된 폴더 안에서 package.json 파일을 찾아서 expres..
[node.js] express cookie-parser Installation $ npm install cookie-parser API var express = require('express') var cookieParser = require('cookie-parser') var app = express() app.use(cookieParser()) cookieParser(secret, options) secret a string used for signing cookies. This is optional and if not specified, will not parse signed cookies. options an object that is passed to cookie.parse as the second option. See cookie for more..

반응형