claude went crazy
All checks were successful
Build / test (push) Successful in 9m28s
Build / release (push) Successful in 1s
Build / build (push) Successful in 25s

This commit is contained in:
2026-03-28 02:35:00 -04:00
parent d7d4bbc099
commit 6e40413385
22 changed files with 2167 additions and 787 deletions

33
server/server.js Normal file
View File

@@ -0,0 +1,33 @@
import express from 'express';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { router } from './routes.js';
const __dirname = dirname(fileURLToPath(import.meta.url));
const PORT = process.env.PORT ?? 3000;
export const app = express();
app.use(express.json());
// API
app.use('/api', router);
// Static files
app.use(express.static(join(__dirname, '..')));
// SPA fallback — all non-API, non-asset routes serve index.html
app.get('*', (req, res) => {
res.sendFile(join(__dirname, '../index.html'));
});
// Error handler
app.use((err, _req, res, _next) => {
console.error(err);
res.status(500).json({ error: 'internal server error' });
});
// Boot — only when run directly, not when imported by tests
if (process.argv[1] === fileURLToPath(import.meta.url)) {
app.listen(PORT, () => console.log(`catalyst on :${PORT}`));
}