Add web front-end and fix API issues
This commit is contained in:
1 parent
45ca4de0ad
commit
a7524412f0
2571 files changed
+86998
-5
No files matched your search
+9
-1
@@ -2,13 +2,21 @@ import express from 'express';
|
||||
import { Pool } from 'pg';
|
||||
import { CategoryRepository } from './category.repository.ts';
|
||||
import { createCategoryRouter } from './category.router.ts';
|
||||
import { join } from 'node:path';
|
||||
import process from 'node:process';
|
||||
|
||||
try {
|
||||
process.loadEnvFile(join(import.meta.dirname, '../.env'));
|
||||
} catch (e) {
|
||||
console.warn('⚠️ API Warning: Could not locate local .env file natively.');
|
||||
}
|
||||
|
||||
const app = express();
|
||||
const port = process.env.API_PORT || 8300;
|
||||
|
||||
// Initialize your database pool
|
||||
const pool = new Pool({
|
||||
connectionString: process.env.DATABASE_URL
|
||||
connectionString: process.env.DATABASE_URL || process.env.INTERNAL_PROD_DB_URL
|
||||
});
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
Reference in new issue
Block a user