mirror of
https://git.cant.at/Madeorsk/PollVerlaine
synced 2025-01-02 14:27:55 +01:00
Updated README and API documentation.
This commit is contained in:
parent
7b0a619b0e
commit
401adb726b
15
API.md
15
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
|
||||
|
||||
@ -37,7 +37,7 @@ Return a Poll.
|
||||
### Delete a poll
|
||||
|
||||
```
|
||||
DELETE /polls/:id
|
||||
DELETE /polls/:id/:token
|
||||
```
|
||||
|
||||
Return a Poll.
|
||||
@ -47,21 +47,24 @@ 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 |
|
||||
| `delete_token` | Deletion token. | yes |
|
||||
|
||||
### Options
|
||||
|
||||
| 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 |
|
||||
| `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
|
||||
|
||||
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;
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user