Initial commit of MindShift CBT Therapy app
This commit is contained in:
30
MindShift-Windows/dev-server.js
Normal file
30
MindShift-Windows/dev-server.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const express = require('express');
|
||||
const path = require('path');
|
||||
const app = express();
|
||||
const PORT = 12005;
|
||||
|
||||
// Serve static files from the src directory
|
||||
app.use(express.static(path.join(__dirname, 'src')));
|
||||
|
||||
// Serve the main app
|
||||
app.get('/', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'src', 'index.html'));
|
||||
});
|
||||
|
||||
// Start the dev server
|
||||
const server = app.listen(PORT, () => {
|
||||
console.log(`Frontend dev server running on http://localhost:${PORT}`);
|
||||
});
|
||||
|
||||
// Keep the server running
|
||||
process.on('SIGINT', () => {
|
||||
console.log('Shutting down dev server...');
|
||||
server.close(() => {
|
||||
process.exit(0);
|
||||
});
|
||||
});
|
||||
|
||||
// Prevent the process from exiting
|
||||
setInterval(() => {
|
||||
// Keep alive
|
||||
}, 1000);
|
||||
Reference in New Issue
Block a user