make sure the DB is initiated
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
import Database from 'better-sqlite3';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { DB_FULLPATH } from '../../routes';
|
||||
|
||||
const fullPath = DB_FULLPATH;
|
||||
const dir = path.dirname(fullPath);
|
||||
// make sure the DB is initiated
|
||||
import '../../init/init_db'
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir);
|
||||
}
|
||||
|
||||
export const db = new Database(fullPath);
|
||||
export const db = new Database(DB_FULLPATH);
|
||||
|
||||
@@ -39,4 +39,4 @@ export const API_ROUTES = {
|
||||
USER: (userId: string) => `/api/users/${userId}`
|
||||
};
|
||||
|
||||
export const DB_FULLPATH = dev ? './src/lib/data/tatort.db' : '/daten/tatort.db'
|
||||
export const DB_FULLPATH = dev ? './src/lib/data/tatort.db' : '/daten/tatort.db';
|
||||
Reference in New Issue
Block a user