description | ELECTRONIC VOTE REST API SERVER (school project) |
owner | as2023.mta5x@slmail.me |
last change | Wed, 11 Oct 2023 02:39:28 +0000 (10 23:39 -0300) |
URL | git://repo.or.cz/asis23-votoe-server.git |
https://repo.or.cz/asis23-votoe-server.git | |
push URL | ssh://repo.or.cz/asis23-votoe-server.git |
https://repo.or.cz/asis23-votoe-server.git (learn more) | |
bundle info | asis23-votoe-server.git downloadable bundles |
content tags |
POST /candidates {"name":string} -> {"id":number,"name":string}
DELETE /candidates/id
GET /candidates -> [{"id":number,"name":string}]
DELETE /candidates
POST /vote {"id":number}
GET /report -> [{"id":number,"name":string,"votes":number}]
Primero hay que instalar sqlite.
En mi caso (termux), el comando para instalar SQLite es:
$ pkg install sqlite
Controlar que SQLite esté habilitado en PHP.
$ php -i | grep -i 'sqlite' | grep -i 'ena'
PDO Driver for SQLite 3.x => enabled
SQLite3 support => enabled
Crear la base de datos con el siguiente comando:
$ sqlite3 database.sqlite < votar.sql
En la siguiente página se puede aprender un poco más sobre SQLite: SQLite PHP.
Build (docker/container) image
docker build --rm \
--tag 'edi2/server' \
.
Run PHP server
docker run --tty --interactive --rm \
--name edi2-server \
--publish 8080:80 \
edi2/server
13 months ago | master | logtree |
13 months ago | 00_diagramas | logtree |
13 months ago | 06_get_report | logtree |
13 months ago | 05_post_vote | logtree |
13 months ago | 04_delete_candidates | logtree |
13 months ago | 03_get_candidates | logtree |
13 months ago | 01_post_candidates | logtree |
13 months ago | 02_delete_candidates_id | logtree |