brew install mysql
brew install nginx
brew install imagemagick
brew tap homebrew/science
brew install opencv
npm install -g supervisor
npm install -g gulp
mysql -uroot;
create database image;
git clone
cd nimage
npm install
bower install
gulp
// DB 초기화 할때만 사용(주의! 데이터베이스 내용 초기화됨)
DBSYNC=true supervisor -i public/ app.js
supervisor -i public/ app.js
server {
listen 80;
charset utf-8;
server_name local.i.niceilm.net;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3007;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
// multipart
// 단건
// parameters
name=file
// returns
[{url:"http://i.niceilm.net/dn/:hashedId", width:300, height:200, size:3000, type:'jpeg'}]
// 여러건
// parameters
name=file
name=file
// returns
[{"url":"http://i.niceilm.net/dn/RAma6DleAlw9PGB2","width":647,"height":1145,"size":128354,"type":"image/png","hashedId":"RAma6DleAlw9PGB2"},{"url":"http://i.niceilm.net/dn/pqmvQDbOByoVE0M2","width":645,"height":1144,"size":573061,"type":"image/png","hashedId":"pqmvQDbOByoVE0M2"}]
// 단건
// parameters
{url:""}
// returns
[{url:"http://i.niceilm.net/dn/:hashedId", width:300, height:200, size:3000, type:'jpeg'}]
// 복수개
// parameters
{"url":["http://dimg.donga.com/wps/SPORTS/IMAGE/2010/05/19/24690964.4.jpg", "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS-DF9b7N3TG5dEZKjW7UUValVA1wV5c5dz_FK67cjz4w6G-55dVw"]}
// returns
[{"url":"http://i.niceilm.net/dn/Vgn3QYRleDvrZq4k","width":398,"height":499,"size":93682,"type":"image/jpeg","hashedId":"Vgn3QYRleDvrZq4k"},{"url":"http://i.niceilm.net/dn/OXMkrNBmXDgJ7m8l","width":284,"height":177,"size":8317,"type":"image/jpeg","hashedId":"OXMkrNBmXDgJ7m8l"}]
// parameters
{cropwidth:0, cropheight:0, x:0, y:0, src:""}
// returns
{url:"http://i.niceilm.net/dn/:hashedId", width:300, height:200, size:3000, type:'jpeg'}
// returns
image file
http://i.niceilm.net/dn/Pq7r0ny2M3KopjdL
http://i.niceilm.net/dn/Pq7r0ny2M3KopjdL?width=200
http://i.niceilm.net/dn/Pq7r0ny2M3KopjdL?width=200&height=300
sudo npm install jasmine-node@1.14.2 -g
jasmine-node test/
- API KEY 방식으로 변경(업로드시에만 API KEY 체크)
- 로그인 기반 변경(페이스북/이메일기반)
- 앱생성/삭제
- http://i.niceilm.net/dn/someappname/:hashId?type=:type&width=:width&height=:height