Changed folder structure
BIN
data/uploads/books/slone/FestGehalten_web.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
data/uploads/books/slone/Zirkel_web.png
Normal file
|
After Width: | Height: | Size: 938 KiB |
BIN
data/uploads/books/slone/ausgeliefert.png
Normal file
|
After Width: | Height: | Size: 6.1 MiB |
BIN
data/uploads/books/slone/dreieck.png
Normal file
|
After Width: | Height: | Size: 6.7 MiB |
BIN
data/uploads/books/slone/familienspiele.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
data/uploads/books/slone/festgewickelt.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
data/uploads/books/slone/geschwisterliebe.png
Normal file
|
After Width: | Height: | Size: 6.9 MiB |
BIN
data/uploads/books/slone/mutter.png
Normal file
|
After Width: | Height: | Size: 3.4 MiB |
BIN
data/uploads/books/slone/sabrina.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
data/uploads/books/slone/zweifrauen.png
Normal file
|
After Width: | Height: | Size: 5.8 MiB |
BIN
data/uploads/profiles/slone/photo.jpg
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
data/uploads/profiles/slone/photo2.jpg
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
data/uploads/profiles/slone/photo3.jpg
Normal file
|
After Width: | Height: | Size: 163 KiB |
|
|
@ -28,6 +28,7 @@ const DATA_FILE = path.join(DATA_DIR, "database.json");
|
||||||
async function initDatabase(): Promise<AuthorData> {
|
async function initDatabase(): Promise<AuthorData> {
|
||||||
try {
|
try {
|
||||||
await fs.mkdir(DATA_DIR, { recursive: true });
|
await fs.mkdir(DATA_DIR, { recursive: true });
|
||||||
|
await fs.mkdir(path.join(DATA_DIR, "uploads"), { recursive: true });
|
||||||
try {
|
try {
|
||||||
const existingData = await fs.readFile(DATA_FILE, "utf-8");
|
const existingData = await fs.readFile(DATA_FILE, "utf-8");
|
||||||
const parsed = JSON.parse(existingData) as AuthorData;
|
const parsed = JSON.parse(existingData) as AuthorData;
|
||||||
|
|
@ -205,6 +206,9 @@ Die Synopsis soll neugierig machen, stark die visuelle Stimmung rüberbringen un
|
||||||
|
|
||||||
// Configure Vite middleware or static serve
|
// Configure Vite middleware or static serve
|
||||||
async function startServer() {
|
async function startServer() {
|
||||||
|
// Serve the dynamic uploads directory statically
|
||||||
|
app.use("/uploads", express.static(path.join(process.cwd(), "data", "uploads")));
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "production") {
|
if (process.env.NODE_ENV !== "production") {
|
||||||
const { createServer: createViteServer } = await import("vite");
|
const { createServer: createViteServer } = await import("vite");
|
||||||
const vite = await createViteServer({
|
const vite = await createViteServer({
|
||||||
|
|
|
||||||