From 401adb726b9763ba9c8c5cfa8427ec0249d6b96b Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Thu, 16 Aug 2018 14:16:50 +0200 Subject: [PATCH] Updated README and API documentation. --- API.md | 37 ++++++++++++++++++++----------------- README.md | 14 +++++++++----- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/API.md b/API.md index a20505c..f1e48e0 100644 --- a/API.md +++ b/API.md @@ -4,7 +4,7 @@ ### Create a poll ``` -POST /polls + POST /polls ``` | Field | Description | Optional | @@ -13,7 +13,7 @@ POST /polls | `options` | All the options. Array of strings. | no | | `settings` | A Settings object. | yes | -Return a Poll. +Return a Poll with `delete_token`. ### Retrieve a poll @@ -26,7 +26,7 @@ Return a Poll. ### Vote ``` -POST /polls/:id/vote +POST /polls/:id/vote ``` | Field | Description | Optional | | -------------- | -------------------------------------------- | ---------- | @@ -37,7 +37,7 @@ Return a Poll. ### Delete a poll ``` -DELETE /polls/:id +DELETE /polls/:id/:token ``` Return a Poll. @@ -46,22 +46,25 @@ Return a Poll. ### Poll -| Attribute | Description | Nullable | -| --------------- | ------------------------------------ | ---------- | -| `id` | | no | -| `title` | The question. | no | -| `options` | All the options. Array of Options. | no | -| `settings` | A Settings object. | no | -| `creation_date` | Creation date. | no | +| Attribute | Description | Nullable | +| ------------------ | ------------------------------------ | ---------- | +| `id` | | no | +| `title` | The question. | no | +| `options` | All the options. Array of Options. | no | +| `settings` | A Settings object. | no | +| `creation_date` | Creation date. | no | +| `delete_token` | Deletion token. | yes | ### Options -| Attribute | Description | Nullable | -| --------------- | ------------------------------------ | ---------- | -| `label` | The option. | no | +| Attribute | Description | Nullable | +| ------------------ | ------------------------------------ | ---------- | +| `label` | The option. | no | +| `votes` | Numbers of votes. | yes | ### Settings -| Attribute | Description | Nullable | -| --------------- | ------------------------------------ | ---------- | -| `unique_ip` | One vote per IP address. Boolean. | yes | +| Attribute | Description | Nullable | +| ------------------ | ----------------------------------------------- | ---------- | +| `unique_ip` | One vote per IP address. Boolean. | yes | +| `multiple_choices` | Allow multiple choices in one vote. Boolean. | yes | diff --git a/README.md b/README.md index 300c44c..5e20c3a 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,30 @@ A small alternative to Straw Poll. ## Installation -Clone the repository : +Clone the repository: ```sh mkdir db && touch db/polls.db && composer install ``` -Uncomment the `dba` extention in `php.ini` : +Enable the `dba` extension in `php.ini`: ``` extension=dba ``` +### Configuration + Rename `config/app.example.php` to `config/app.php`. -Sample configuration for nginx : +Configure `app_url` to the root url of Poll Verlaine. + +Sample configuration for nginx: ```nginx location / { - try_files $uri /index.php =404; + try_files $uri /index.php; } ``` ## API -See [API.md](API.md). \ No newline at end of file +See [API.md](API.md).