/** * BreakPilot H5P Service - Simplified Version * Minimal H5P integration without h5p-express complexity */ import express from 'express'; import cors from 'cors'; import path from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const app = express(); const PORT = process.env.PORT || 8080; // Middleware app.use(cors()); app.use(express.json({ limit: '500mb' })); app.use(express.urlencoded({ extended: true, limit: '500mb' })); // Serve static H5P files app.use('/h5p/core', express.static(path.join(__dirname, 'h5p-core'))); app.use('/h5p/libraries', express.static(path.join(__dirname, 'h5p-libraries'))); app.use('/h5p/content', express.static(path.join(__dirname, 'h5p-content'))); // Serve editors app.use('/h5p/editors', express.static(path.join(__dirname, 'editors'))); // Serve players app.use('/h5p/players', express.static(path.join(__dirname, 'players'))); // Content type specific editors app.get('/h5p/editor/quiz', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'quiz-editor.html')); }); app.get('/h5p/player/quiz', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'quiz-player.html')); }); app.get('/h5p/editor/flashcards', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'flashcards-editor.html')); }); app.get('/h5p/editor/fill-blanks', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'fill-blanks-editor.html')); }); app.get('/h5p/player/fill-blanks', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'fill-blanks-player.html')); }); app.get('/h5p/editor/memory', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'memory-editor.html')); }); app.get('/h5p/player/memory', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'memory-player.html')); }); app.get('/h5p/editor/drag-drop', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'drag-drop-editor.html')); }); app.get('/h5p/player/drag-drop', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'drag-drop-player.html')); }); app.get('/h5p/editor/timeline', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'timeline-editor.html')); }); app.get('/h5p/player/timeline', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'timeline-player.html')); }); app.get('/h5p/editor/interactive-video', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'interactive-video-editor.html')); }); app.get('/h5p/player/interactive-video', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'interactive-video-player.html')); }); app.get('/h5p/editor/course-presentation', (req, res) => { res.sendFile(path.join(__dirname, 'editors', 'course-presentation-editor.html')); }); app.get('/h5p/player/course-presentation', (req, res) => { res.sendFile(path.join(__dirname, 'players', 'course-presentation-player.html')); }); // Main H5P Editor Selection Page app.get('/h5p/editor/new', (req, res) => { res.send(` H5P Editor - BreakPilot

πŸŽ“ H5P Content Creator Beta

πŸ“š Willkommen im H5P Content Creator!

Erstelle interaktive Lerninhalte wie Quizze, Videos mit Fragen, PrΓ€sentationen und vieles mehr. H5P (HTML5 Package) ermΓΆglicht es, ansprechende und interaktive Bildungsinhalte zu erstellen, die auf allen GerΓ€ten funktionieren.

Beliebte Content-Typen

✍️

Quiz (Question Set)

Multiple-Choice-Tests mit sofortigem Feedback und Punktebewertung

🎬

Interactive Video

Videos mit eingebetteten Fragen, Links und anderen interaktiven Elementen

πŸ“Š

Course Presentation

PrΓ€sentationen mit interaktiven Folien, Fragen und Multimedia-Inhalten

πŸƒ

Flashcards

Lernkarten zum Üben und Wiederholen von Vokabeln und Konzepten

πŸ“…

Timeline

Interaktive Zeitstrahle mit Bildern, Videos und Beschreibungen

🎯

Drag and Drop

Elemente ziehen und an der richtigen Stelle ablegen - ideal fΓΌr Zuordnungsaufgaben

πŸ“

Fill in the Blanks

LΓΌckentexte mit automatischer Korrektur und Hinweisen

🧠

Memory Game

Klassisches Memory-Spiel mit Bildern oder Text-Paaren

βœ… Alle Editoren verfΓΌgbar!

Alle 8 Content-Typen sind jetzt verfΓΌgbar: Quiz, Interactive Video, Course Presentation, Flashcards, Timeline, Drag and Drop, Fill in the Blanks und Memory Game! Klicke auf eine Kachel, um den Editor zu ΓΆffnen.

`); }); // Health & Info app.get('/', (req, res) => { res.send(` BreakPilot H5P Service

πŸŽ“ H5P Service

βœ… Running (Simplified)

Vereinfachte H5P-Integration fΓΌr BreakPilot Studio

H5P Editor ΓΆffnen Health Check
`); }); app.get('/health', (req, res) => { res.json({ status: 'healthy', service: 'h5p-service-simplified', version: '1.0.0-simple' }); }); // Export app for testing export { app }; // Start server only when run directly (not imported for tests) const isMainModule = import.meta.url === `file://${process.argv[1]}`; if (isMainModule) { app.listen(PORT, () => { console.log(` ╔════════════════════════════════════════════════════╗ β•‘ πŸŽ“ BreakPilot H5P Service (Simplified) β•‘ β•‘ πŸ“ http://localhost:${PORT} β•‘ β•‘ βœ… Ready to serve H5P content! β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• `); }); }