chore: initial project scaffold with Fastify server and Vite React app
Set up monorepo structure with server/ (Fastify + TypeScript) and web/ (React + Vite + TypeScript). Includes package configs, dev proxy setup, and mobile-first CSS foundation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
3
server/src/config.ts
Normal file
3
server/src/config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const PORT = parseInt(process.env.PORT || '3000', 10);
|
||||
export const DB_PATH = process.env.DB_PATH || './data/spelljammer.sqlite';
|
||||
export const NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
20
server/src/index.ts
Normal file
20
server/src/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import Fastify from 'fastify';
|
||||
import { PORT } from './config.js';
|
||||
|
||||
const app = Fastify({ logger: true });
|
||||
|
||||
app.get('/', async () => {
|
||||
return { name: 'Spelljammer Ship Tracker API', status: 'ok' };
|
||||
});
|
||||
|
||||
const start = async () => {
|
||||
try {
|
||||
await app.listen({ port: PORT, host: '0.0.0.0' });
|
||||
console.log(`Server running on port ${PORT}`);
|
||||
} catch (err) {
|
||||
app.log.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
start();
|
||||
Reference in New Issue
Block a user