Files
Filamenteka/server.js
DaX c394d94bb0 Initial Filamenteka setup - Bambu Lab filament tracker
- React + TypeScript frontend with automatic color coding
- Confluence API integration for data sync
- AWS Amplify deployment with Terraform
- Support for all Bambu Lab filament colors including gradients
2025-06-17 22:39:35 +02:00

30 lines
704 B
JavaScript

import express from 'express';
import { handler } from './src/pages/api/filaments.js';
const app = express();
const port = 3000;
app.get('/api/filaments', async (req, res) => {
const event = {
httpMethod: 'GET',
headers: req.headers,
queryStringParameters: req.query
};
try {
const response = await handler(event);
res.status(response.statusCode);
Object.entries(response.headers || {}).forEach(([key, value]) => {
res.setHeader(key, value);
});
res.send(response.body);
} catch (error) {
res.status(500).json({ error: error.message });
}
});
app.listen(port, () => {
console.log(`API server running at http://localhost:${port}`);
});