Add installer script and serve static files

This commit is contained in:
2025-12-08 15:41:14 +07:00
parent 86e69813b4
commit b3f73fd331
3 changed files with 92 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
require('dotenv').config();
const express = require('express');
const path = require('path');
const cors = require('cors');
const { Pool } = require('pg');
const { exec } = require('child_process');
@@ -10,6 +11,9 @@ const PORT = process.env.PORT || 3000;
app.use(cors());
app.use(express.json());
// Serve static files from the parent directory (frontend)
app.use(express.static(path.join(__dirname, '../')));
// Database Connection Pool (PostgreSQL)
const pool = new Pool({
host: process.env.DB_HOST || 'localhost',