Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ function config ( ) {
* See README.md for info about all the supported ENV VARs
*/
env.DISPLAY_UNITS = readENV('DISPLAY_UNITS', 'mg/dl');

// be lenient at accepting the mmol input
if (env.DISPLAY_UNITS.toLowerCase().includes('mmol')) {
env.DISPLAY_UNITS = 'mmol';
} else {
// also ensure the mg/dl is set with expected case
env.DISPLAY_UNITS = 'mg/dl';
}

console.log('Units set to', env.DISPLAY_UNITS );

env.PORT = readENV('PORT', 1337);
env.HOSTNAME = readENV('HOSTNAME', null);
env.IMPORT_CONFIG = readENV('IMPORT_CONFIG', null);
Expand Down