Skip to content

Commit

Permalink
change domain info and add demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
itchenyi committed Oct 19, 2016
1 parent 85d709f commit adc87d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ $PATH/sbin/nginx -c $PATH/lua-file-upload/nginx.conf
```
curl -i http://localhost:8000/api
HTTP/1.1 200 OK
Server: openresty/1.11.2.1
Date: Tue, 18 Oct 2016 11:20:22 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Expand All @@ -37,7 +36,19 @@ Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
{"file":"ok.txt","size":0,"path":"static.touzhijia.net\/test\/ok.txt"}
{"file":"ok.txt","size":0,"path":"coreos.me\/test\/ok.txt"}
#: 如果文件存在, 替换文件
curl -i -X POST -H "Content-Type: multipart/form-data;" -F "path=test" -F "force=true" -F "file=@./ok.txt" "http://localhost:8000/api/upload"
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Wed, 19 Oct 2016 02:19:41 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
{"file":"ok.txt","size":0,"path":"coreos.me\/test\/ok.txt"}
```


Expand Down
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ http {
set $save_tempdr '/tmp';
set $upload_root '/data/wwwroot';
set $render_url 'static.touzhijia.net';
set $render_url 'coreos.me';
content_by_lua_file ./upload_api.lua;
}
}
Expand Down

0 comments on commit adc87d9

Please sign in to comment.