History of 2020-08-03 Look up a global variable in the database in Node.js

2020-08-03
14:55 UTC Revision 1 . . . . mborkToday I encountered an interesting problem. Assume that you want a global constant in your Node.js backend, but its actual value is to be taken from a database. This means that fetching the constant should be done asynchronously. Unless you use Node.js 14.3.0 or newer (which as the time of me writing this is not yet ubiquitous), you cannot await your database request at the top level