I don’t speak pug, but you have a script tag in shortened.pug, and your app seems to be using form.pug. I think you just need to add it to the other file.
The script is for shortened.pug not form.pug. Both inline and separated client side JavaScript don’t work
It works fine when not wrapped in the database calls, so I’d suggest looking into that: https://daffodil-sword.glitch.me/