mirror of
https://git.cant.at/Madeorsk/PollVerlaine
synced 2025-01-05 00:07:55 +01:00
Updated README and API documentation.
This commit is contained in:
parent
7b0a619b0e
commit
401adb726b
35
API.md
35
API.md
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
### Create a poll
|
### Create a poll
|
||||||
```
|
```
|
||||||
POST /polls
|
POST /polls
|
||||||
```
|
```
|
||||||
|
|
||||||
| Field | Description | Optional |
|
| Field | Description | Optional |
|
||||||
@ -13,7 +13,7 @@ POST /polls
|
|||||||
| `options` | All the options. Array of strings. | no |
|
| `options` | All the options. Array of strings. | no |
|
||||||
| `settings` | A Settings object. | yes |
|
| `settings` | A Settings object. | yes |
|
||||||
|
|
||||||
Return a Poll.
|
Return a Poll with `delete_token`.
|
||||||
|
|
||||||
### Retrieve a poll
|
### Retrieve a poll
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ Return a Poll.
|
|||||||
### Delete a poll
|
### Delete a poll
|
||||||
|
|
||||||
```
|
```
|
||||||
DELETE /polls/:id
|
DELETE /polls/:id/:token
|
||||||
```
|
```
|
||||||
|
|
||||||
Return a Poll.
|
Return a Poll.
|
||||||
@ -46,22 +46,25 @@ Return a Poll.
|
|||||||
|
|
||||||
### Poll
|
### Poll
|
||||||
|
|
||||||
| Attribute | Description | Nullable |
|
| Attribute | Description | Nullable |
|
||||||
| --------------- | ------------------------------------ | ---------- |
|
| ------------------ | ------------------------------------ | ---------- |
|
||||||
| `id` | | no |
|
| `id` | | no |
|
||||||
| `title` | The question. | no |
|
| `title` | The question. | no |
|
||||||
| `options` | All the options. Array of Options. | no |
|
| `options` | All the options. Array of Options. | no |
|
||||||
| `settings` | A Settings object. | no |
|
| `settings` | A Settings object. | no |
|
||||||
| `creation_date` | Creation date. | no |
|
| `creation_date` | Creation date. | no |
|
||||||
|
| `delete_token` | Deletion token. | yes |
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Attribute | Description | Nullable |
|
| Attribute | Description | Nullable |
|
||||||
| --------------- | ------------------------------------ | ---------- |
|
| ------------------ | ------------------------------------ | ---------- |
|
||||||
| `label` | The option. | no |
|
| `label` | The option. | no |
|
||||||
|
| `votes` | Numbers of votes. | yes |
|
||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
|
|
||||||
| Attribute | Description | Nullable |
|
| Attribute | Description | Nullable |
|
||||||
| --------------- | ------------------------------------ | ---------- |
|
| ------------------ | ----------------------------------------------- | ---------- |
|
||||||
| `unique_ip` | One vote per IP address. Boolean. | yes |
|
| `unique_ip` | One vote per IP address. Boolean. | yes |
|
||||||
|
| `multiple_choices` | Allow multiple choices in one vote. Boolean. | yes |
|
||||||
|
12
README.md
12
README.md
@ -4,23 +4,27 @@ A small alternative to Straw Poll.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Clone the repository :
|
Clone the repository:
|
||||||
```sh
|
```sh
|
||||||
mkdir db && touch db/polls.db && composer install
|
mkdir db && touch db/polls.db && composer install
|
||||||
```
|
```
|
||||||
|
|
||||||
Uncomment the `dba` extention in `php.ini` :
|
Enable the `dba` extension in `php.ini`:
|
||||||
```
|
```
|
||||||
extension=dba
|
extension=dba
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
Rename `config/app.example.php` to `config/app.php`.
|
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
|
```nginx
|
||||||
location /
|
location /
|
||||||
{
|
{
|
||||||
try_files $uri /index.php =404;
|
try_files $uri /index.php;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user