Added useFetch hook. Updated database check.

This commit is contained in:
Mike Cao committed 2020-08-30 15:29:31 -07:00
1 parent 7a81dda7b6
commit d0ca0819c6
14 files changed
+146 -237

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@ const path = require('path');
const databaseType =
process.env.DATABASE_TYPE || (process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0]);
if (!databaseType) {
throw new Error('Database schema not specified');
if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
throw new Error('Missing or invalid database');
}
console.log(`Database schema detected: ${databaseType}`);