3 * Helper to get a value from an array.
5 * @param array $haystack
7 * @param mixed $default
9 function array_get($haystack, $needle, $default = null) {
10 return isset($haystack[$needle])
15 // Override environment variables array
20 <meta charset
="utf-8">
21 <title
>VOTE REST API Client
</title
>
22 <link rel
="stylesheet" href
="styles/normalize.css"/>
23 <link rel
="stylesheet" href
="styles/main.css"/>
24 <link rel
="stylesheet" href
="styles/menu.css"/>
25 <link rel
="stylesheet" href
="styles/admin.css"/>
26 <link rel
="stylesheet" href
="styles/vote.css"/>
27 <link rel
="stylesheet" href
="styles/report.css"/>
31 <button
>Admin
</button
>
33 <button
>Report
</button
>
38 <li
>Name1
<button
>Delete
</button
></li
>
39 <li
>Name2
<button
>Delete
</button
></li
>
40 <li
>Name3
<button
>Delete
</button
></li
>
42 <form action
="" method
="dialog">
45 <input type
="submit" value
="Add" />
50 <li
><button
>Name
1</button
></li
>
51 <li
><button
>Name
2</button
></li
>
52 <li
><button
>Name
3</button
></li
>
80 <script src
="scripts/rest-api.js"></script
>
81 <script src
="scripts/menu.js"></script
>
82 <script src
="scripts/admin.js"></script
>
83 <script src
="scripts/vote.js"></script
>
84 <script src
="scripts/report.js"></script
>
85 <script src
="scripts/main.js"></script
>
87 const config
= (() => {
90 host
: '<?php echo array_get($_ENV, 'RESTAPI_HOST
', '') ?>',
91 port
: '<?php echo array_get($_ENV, 'RESTAPI_PORT
', '') ?>',