`<meta>` tags have been added to relay information for websites trying
to pull information from the page (like discord) as well as web crawlers
to index the page.
This way, people can easily just use their QR readers to reach the
voting page. The QR is constructed via Google Charts API and the URL is
based on the HOST header of the request.
The API has been moved to a /api path to distinguish it from the form
submission path and make it clear it is a callable API.
The API also has been rudimentarily documented.
Duplicate entries were deduplicated during saving but not checked for
when verifying for at least 2 options set. This lead to being able to
have polls with only a single vote.
Now deduplication is run at the start of the creation function.
The options only appeared when at least 2 letters were typed into the
input field as the event triggered before a value was set into the input
field. Using `keyup` instead of `keydown` delays the event after a
letter has been typed into it.
When a heroku dyno goes into sleep mode it loses connection to the
backend database. Once it is woken back up, no more reads or
writes could be done anymore due to a dead connection. This change
reinstates a new db connection when the connection is fatally
terminated.
Including to the previous flatfile storage, a new storage for MySQL has
been added to store polls in a database.
The amount of possible Poll Options has also been reduced to 20.
This page displays all options that have been set on creation. Thanks to
`textFit` the texts in the title and options automatically get sized
correctly. The create poll button has also been renamed to submit-button
to make it more universal on other pages.
If more than 3 options are written down, additional inputs will load in
to allow more options. The maximum cap of options currently is set to
255 but can be configured in Config.ts.
Likewise, the input length can also be controlled from there.
The frontend should work without having JS enabled. JS will enhance the
experience but should under no circumstance be necessary.
To achieve this, the entire entry system has been turned into a form
that posts its values to a new backend path specifically made to take
form responses. Instead of returning an API response, it also redirects
the browser to either the voting page on successful creation or the
frontpage with a bunch of get parameters that are used to prefill the
form in a server-side rendering process.
An error parameter is also given but there is no way to display said
error for now.
ESLint in this project is by default configured to lint NodeJS
source code. The `./frontend` folder contains browser source code
though, so a new `.eslintrc` sets that for the frontend folder.