chore: print data extracted from environment.
This commit is contained in:
@@ -25,7 +25,7 @@ Compile:
|
|||||||
Run:
|
Run:
|
||||||
|
|
||||||
```
|
```
|
||||||
NODE_ENV=production HTTP_PORT=1234 DATABASE_PATH=/opt/owofannouncements/data.db UPLOADS_DIR=/opt/owofannouncements/uploads node /opt/owofannouncements/server/src/server/main.ts
|
NODE_ENV=production HTTP_PORT=19285 DATABASE_PATH=/opt/owofannouncements/data.db UPLOADS_DIR=/opt/owofannouncements/uploads node /opt/owofannouncements/server/src/server/main.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy to server:
|
Copy to server:
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ import SQLite from "better-sqlite3";
|
|||||||
import { Kysely, SqliteDialect } from "kysely";
|
import { Kysely, SqliteDialect } from "kysely";
|
||||||
import type { Database } from "./types.ts";
|
import type { Database } from "./types.ts";
|
||||||
|
|
||||||
|
const databasePath = process.env.DATABASE_PATH ?? "./data.db";
|
||||||
|
console.log(`Using ${databasePath} as database path`);
|
||||||
const dialect = new SqliteDialect({
|
const dialect = new SqliteDialect({
|
||||||
database: new SQLite(process.env.DATABASE_PATH ?? "./data.db"),
|
database: new SQLite(databasePath),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const db = new Kysely<Database>({
|
export const db = new Kysely<Database>({
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import z from "zod";
|
|||||||
import { db } from "./db/database.ts";
|
import { db } from "./db/database.ts";
|
||||||
|
|
||||||
const baseUploadsFolder = process.env.UPLOADS_DIR ?? "uploads/";
|
const baseUploadsFolder = process.env.UPLOADS_DIR ?? "uploads/";
|
||||||
|
console.log(`Using ${baseUploadsFolder} as base uploads folder`);
|
||||||
|
|
||||||
const upload = multer({
|
const upload = multer({
|
||||||
dest: baseUploadsFolder,
|
dest: baseUploadsFolder,
|
||||||
|
|||||||
Reference in New Issue
Block a user