[O] Data dir prefix
This commit is contained in:
@@ -40,3 +40,6 @@ yarn-error.log*
|
||||
**/*.log
|
||||
package-lock.json
|
||||
**/*.bun
|
||||
|
||||
/data
|
||||
/*.JPG
|
||||
|
||||
+4
-3
@@ -3,8 +3,9 @@ import ExifReader from "exifreader"
|
||||
import { exists, mkdir } from "fs/promises"
|
||||
|
||||
// --- Configuration ---
|
||||
const FOLDER_PHOTOS = "./photos"
|
||||
const FILE_METADATA = "./metadata.json"
|
||||
const FOLDER_BASE = "./data"
|
||||
const FOLDER_PHOTOS = `${FOLDER_BASE}/photos`
|
||||
const FILE_METADATA = `${FOLDER_BASE}/metadata.json`
|
||||
|
||||
// --- Types ---
|
||||
// Interface for our metadata entries
|
||||
@@ -67,7 +68,7 @@ async function getExifData(file: File): Promise<any> {
|
||||
// Load secrets and ensure directories exist before starting
|
||||
const INSTANT_KEY = process.env.INSTANT_KEY
|
||||
if (!INSTANT_KEY) throw new Error("INSTANT_KEY is not defined")
|
||||
if (!await exists(FOLDER_PHOTOS)) await mkdir(FOLDER_PHOTOS)
|
||||
if (!await exists(FOLDER_PHOTOS)) await mkdir(FOLDER_PHOTOS, { recursive: true })
|
||||
|
||||
console.log("Server starting with valid 'secrets.json'.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user