Files
blitzkit/src/server.ts
T

18 lines
436 B
TypeScript
Raw Normal View History

2023-06-26 15:05:05 +00:00
import express from 'express';
2023-06-26 17:25:28 +00:00
import jsxToSvg from './core/ui/jsxToSvg.js';
import today from './renderers/today.js';
2023-06-26 15:05:05 +00:00
const app = express();
2023-06-26 17:25:28 +00:00
app.get('/', async (req, res) => {
const jsx = await today({ server: 'com', id: 1028700193 });
const svg = await jsxToSvg(jsx);
res.writeHead(200, {
'Content-Type': 'image/svg+xml',
'Content-Length': svg.length,
});
res.end(svg);
2023-06-26 15:05:05 +00:00
});
2023-06-26 17:25:28 +00:00
app.listen(process.env.PORT || 3000);