Reorganize frontend into public/ with pages/ and js/ subdirectories
- public/index.html — landing page at root - public/pages/ — all feature pages (regulations, loadboard, etc.) - public/js/ — api.js, nav.js, mock data files - All links updated to absolute paths (/pages/, /js/) - Express static path updated to serve from public/ - Seed script path updated for new mock data location - README updated with new project structure and setup guide - Added .env.example template Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
7
server/.env.example
Normal file
7
server/.env.example
Normal file
@@ -0,0 +1,7 @@
|
||||
# Environment variables for PilotEdge backend
|
||||
# Copy this to .env and fill in your values
|
||||
|
||||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/pilotedge?schema=public"
|
||||
JWT_SECRET="change-this-to-a-long-random-string"
|
||||
PORT=3000
|
||||
NODE_ENV=development
|
||||
@@ -12,8 +12,8 @@ app.use(cors());
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
// Serve the frontend (static HTML/JS/CSS from project root)
|
||||
app.use(express.static(path.join(__dirname, '..', '..')));
|
||||
// Serve the frontend (static files from public/)
|
||||
app.use(express.static(path.join(__dirname, '..', '..', 'public')));
|
||||
|
||||
// --------------- API Routes ---------------
|
||||
app.use('/api/auth', require('./routes/auth'));
|
||||
|
||||
@@ -11,7 +11,7 @@ const prisma = require('../config/db');
|
||||
|
||||
// Load the mock data files by evaluating them in a controlled context
|
||||
function loadMockData(filename) {
|
||||
const filepath = path.join(__dirname, '..', '..', '..', filename);
|
||||
const filepath = path.join(__dirname, '..', '..', '..', 'public', 'js', filename);
|
||||
const code = fs.readFileSync(filepath, 'utf-8');
|
||||
const context = {};
|
||||
// Execute the JS to populate the const variables
|
||||
|
||||
Reference in New Issue
Block a user