Skip to content

Commit

Permalink
Rename the "website" endpoint to "website-zim".
Browse files Browse the repository at this point in the history
Fix #17
  • Loading branch information
almet committed Jun 20, 2016
1 parent ddb0eb6 commit df2d0cc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 112 deletions.
33 changes: 30 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Exposed API
All APIs are talking JSON over HTTP. As such, all parameters should be sent as
stringified JSON and the Content-Type should be set to "application/json".

POST /websites
==============
POST /website-zim
=================

By posting to this endpoint, you are asking the system to start a new download
of a website and a conversion into a Zim format.
Expand Down Expand Up @@ -47,6 +47,19 @@ Status codes
it contains information about what is missing.
- `201 Created` will be returned if the process started.

Exemple
-------

::

$ http POST http://0.0.0.0:6543/website-url url="https://refugeeinfo.eu/" title="Refugee Info" email="alexis@notmyidea.org"
HTTP/1.1 201 Created

{
"job": "5012abe3-bee2-4dd7-be87-39a88d76035d"
}


GET /status/{jobid}
===================

Expand All @@ -65,6 +78,20 @@ Status codes
- `404 Not Found` will be returned in case the requested job does not exist.
- `200 OK` will be returned in any other case.

Exemple
-------

::

http GET http://0.0.0.0:6543/status/5012abe3-bee2-4dd7-be87-39a88d76035d
HTTP/1.1 200 OK

{
"log": "<snip>",
"status": "finished"
}


Okay, so how do I install it on my server?
##########################################

Expand Down Expand Up @@ -92,7 +119,7 @@ In a separate process, you also need to run the worker::

And you're ready to go. To test it::

$ http POST http://0.0.0.0:6543/website url="https://refugeeinfo.eu/" title="Refugee Info" email="alexis@notmyidea.org"
$ http POST http://0.0.0.0:6543/website-url url="https://refugeeinfo.eu/" title="Refugee Info" email="alexis@notmyidea.org"


Debian dependencies
Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
title: getField('title'),
email: getField('email'),
}
fetch("/website", {
fetch("/website-zim", {
method: "POST",
body: JSON.stringify(content),
headers: {'Content-Type': 'application/json'}
Expand Down
107 changes: 0 additions & 107 deletions static/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion zimit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from zimit.worker import create_zim

website = Service(name='website', path='/website')
website = Service(name='website', path='/website-zim')
home = Service(name='home', path='/')
status = Service(name='status', path='/status/{id}')

Expand Down

0 comments on commit df2d0cc

Please sign in to comment.