Fix: Route-Handler vor static middleware registrieren
express.static hat / abgefangen und index.html direkt geliefert,
bevor der Route-Handler die Platzhalter {{NAME}}/{{SLOGAN}}/{{INITIALS}}
ersetzen konnte.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,8 +11,6 @@ const NAME = process.env.NAME || 'Name';
|
||||
const SLOGAN = process.env.SLOGAN || '';
|
||||
const INITIALS = NAME.split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
||||
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
let html = fs.readFileSync(path.join(__dirname, 'public', 'index.html'), 'utf8');
|
||||
html = html
|
||||
@@ -23,6 +21,8 @@ app.get('/', (req, res) => {
|
||||
res.send(html);
|
||||
});
|
||||
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`LinkedIn Formatter läuft auf http://localhost:${PORT}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user