전체보기 (321) 썸네일형 리스트형 [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.. [node.js] Check synchronously if file/directory exists in Node.js http://stackoverflow.com/questions/4482686/check-synchronously-if-file-directory-exists-in-node-js [node.js] file upload Server.js /*Define dependencies.*/ var express=require("express"); var multer = require('multer'); var app=express(); var done=false; /*Configure the multer.*/ app.use(multer({ dest: './uploads/', rename: function (fieldname, filename) { return filename+Date.now(); }, onFileUploadStart: function (file) { console.log(file.originalname + ' is starting ...') }, onFileUploadComplete: function (file).. [node.js] bodyParser deprecated http://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4 express/connect top-level generic This example demonstrates adding a generic JSON and URL-encoded parser as a top-level middleware, which will parse the bodies of all incoming requests. This is the simplest setup. var express = require('express') var bodyParser = require('body-parser') var app = express() // parse app.. [node.js] .router' is deprecated! 위 오류가 날때... app.router 를 use 하는 라인을 지워주면 된다. 예전에는 넣어줘야되는데 최신버젼에선 없어졌다고 한다. [XE] HTTP 403 Upload Error 일때, 서버관리자 해결법 /var/log/error.log 를 보니 evasive:20 persimission denind 오류가 떠있었다. 그래서 a2dismod evasive 를 하니 일단 오류가 더이상 뜨진 않는다. 이건 극단적인 방법이고, mods-enabled 에서 evasive.conf 를 열어 제한 수를 조정해주는것도 한 방법이 되겠다. Eclipse 에서 Dynamic Web Project, context root 를 / 로 변경 - Project Explorer 뷰 - Project 선택 - Properties - Web Project Settings - Context root 를 / 로 변경 - 메뉴 - Project - Clean - Servers 뷰에서 tomcat 선택, + 펼침, 해당 프로젝트 선택 후 삭제 - Servers 뷰에서 tomcat 선택 - 마우스 우클릭, Clean - Servers 뷰에서 tomcat 선택 - 마우스 우클릭, Add and Remove - 해당 프로젝트 선택후 Add Javascript iBook EPUB 3.0 Images not working iBook 에서 이미지를 클릭 했을때 동적으로 div를 생성하고 그 안에 background-image 스타일 지정을 해주었으나 도통 빈 칸만 뜨고 이미지가 출력되지 않았다. 콘솔로그를 찍어볼 수 없는 거지같은 테스트환경이어서 html 마크업으로 일일히 확인해본 결과 이미지를 불러올때 ibooksimg:// 라는 프로토콜을 사용해야 하지만 ibooks:// 로 불러오면서 이미지가 출력되지 않은 것이었다. var str = $("img").get(0).src; str = str.replace("ibooks://", "ibooksimg://"); 로 간단히 replace 치환처리 하니 정상 출력되었다. 이전 1 ··· 26 27 28 29 30 31 32 ··· 41 다음