feat(db): db stuff added in starting migration from old app
This commit is contained in:
@@ -5,6 +5,8 @@ import { setupRoutes } from "./internal/routerHandler/routeHandler.js";
|
||||
import { printers } from "./internal/ocp/printers/printers.js";
|
||||
import path, { dirname, join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { db } from "./pkg/db/db.js";
|
||||
import { settings } from "./pkg/db/schema/settings.js";
|
||||
|
||||
const PORT = Number(process.env.VITE_PORT) || 4200;
|
||||
|
||||
@@ -19,7 +21,13 @@ const main = async () => {
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Db connection stuff
|
||||
try {
|
||||
const set = await db.select().from(settings);
|
||||
|
||||
console.log(set);
|
||||
} catch (error) {
|
||||
console.error("Error getting settings", error);
|
||||
}
|
||||
// express app
|
||||
const app = express();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user