Updated README
parent
bd8e35a3fb
commit
07082246fe
38
README.rst
38
README.rst
|
@ -12,20 +12,50 @@ Use Redis as cache backend and metadata storage.
|
|||
Installation
|
||||
============
|
||||
|
||||
From PyPI::
|
||||
Install uwsgi and python3 plugin::
|
||||
|
||||
sudo apt-get install uwsgi uwsgi-plugin-python3
|
||||
|
||||
Make virtualenv::
|
||||
|
||||
cd /opt
|
||||
pyvenv-3.4 img_service
|
||||
source img_service/bin/activate
|
||||
|
||||
Install from PyPI::
|
||||
|
||||
pip install imgtohttps
|
||||
|
||||
From GitHub::
|
||||
Create config file for app::
|
||||
|
||||
git clone https://github.com/Orhideous/imgtohttps.git
|
||||
[uwsgi]
|
||||
plugins = python34
|
||||
master = true
|
||||
enable-threads = true
|
||||
processes = 4
|
||||
module = imgtohttps.application:app
|
||||
virtualenv = /opt/img_service
|
||||
chdir = /opt/img_service
|
||||
touch-reload = /opt/img_service/reload
|
||||
env=APP_SETTINGS=settings.Production
|
||||
|
||||
Connect to nginx::
|
||||
|
||||
server {
|
||||
listen 127.0.0.1:2100;
|
||||
access_log off;
|
||||
location / {
|
||||
uwsgi_pass unix:/run/uwsgi/app/img_service/socket;
|
||||
include uwsgi_params;
|
||||
}
|
||||
}
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Request::
|
||||
|
||||
curl -X POST -H "Content-Type: application/json" -d '{"url": "http://example.com/image.png"}' http://localhost:5000
|
||||
curl -X POST -H "Content-Type: application/json" -d '{"url": "http://example.com/image.png"}' http://localhost:2100
|
||||
|
||||
Response::
|
||||
|
||||
|
|
Loading…
Reference in New Issue