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