image operations via Images.js, directory fun via Dirs.js

This commit is contained in:
Zutatensuppe 2021-04-21 19:22:58 +02:00
parent 0cbc8e69a3
commit 1089f70d5e
9 changed files with 122 additions and 166 deletions

14
server/Dirs.js Normal file
View file

@ -0,0 +1,14 @@
import { fileURLToPath } from 'url'
import { dirname } from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const BASE_DIR = `${__dirname}/..`
export const DATA_DIR = `${BASE_DIR}/data`
export const UPLOAD_DIR = `${BASE_DIR}/data/uploads`
export const UPLOAD_URL = `/uploads`
export const COMMON_DIR = `${BASE_DIR}/common/`
export const GAME_DIR = `${BASE_DIR}/game/`
export const TEMPLATE_DIR = `${BASE_DIR}/game/templates`