mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Moving files and rename some of them.
This commit is contained in:
@@ -1,100 +1,3 @@
|
||||
// import { EventEmitter } from 'events';
|
||||
|
||||
//
|
||||
// const eventEmitter = new EventEmitter();
|
||||
//
|
||||
//
|
||||
// export async function GET(request: Request) {
|
||||
// return new Response(new ReadableStream({
|
||||
// async pull(controller) {
|
||||
// eventEmitter.on('modification', (data) => {
|
||||
// controller.enqueue(`event: modification\n`);
|
||||
// controller.enqueue(`data: ${JSON.stringify(data)}\n\n`);
|
||||
// controller.close();
|
||||
// });
|
||||
// },
|
||||
// }), {
|
||||
// status: 200,
|
||||
// headers: {
|
||||
// 'Content-Type': 'text/event-stream',
|
||||
// 'Cache-Control': 'no-cache',
|
||||
// Connection: 'keep-alive',
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// export async function POST(request: Request) {
|
||||
// const data = await request.json();
|
||||
// eventEmitter.emit('modification', data);
|
||||
// return new Response('Event sent', { status: 200 });
|
||||
// }
|
||||
//
|
||||
// const eventEmitter = new EventEmitter();
|
||||
//
|
||||
// export async function GET(request: Request) {
|
||||
// return new Response(new ReadableStream({
|
||||
// async pull(controller) {
|
||||
// eventEmitter.on('modification', (data) => {
|
||||
// console.log('Modification event triggered:', data);
|
||||
// controller.enqueue(`event: modification\n`);
|
||||
// controller.enqueue(`data: ${JSON.stringify(data)}\n\n`);
|
||||
// });
|
||||
//
|
||||
// // Close the controller when the client closes the connection
|
||||
// request.signal.addEventListener('abort', () => {
|
||||
// controller.close();
|
||||
// });
|
||||
// },
|
||||
// }), {
|
||||
// status: 200,
|
||||
// headers: {
|
||||
// 'Content-Type': 'text/event-stream',
|
||||
// 'Cache-Control': 'no-cache',
|
||||
// Connection: 'keep-alive',
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// export async function POST(request: Request) {
|
||||
// const data = await request.json();
|
||||
// console.log(data);
|
||||
// eventEmitter.emit('modification', data);
|
||||
// return new Response('Event sent', { status: 200 });
|
||||
// }
|
||||
// const eventEmitter = new EventEmitter();
|
||||
//
|
||||
// export async function GET(request: Request) {
|
||||
// console.log('GET request received');
|
||||
// return new Response(new ReadableStream({
|
||||
// async pull(controller) {
|
||||
// console.log('Controller created:', controller);
|
||||
// eventEmitter.on('modification', (data) => {
|
||||
// console.log('Modification event triggered:', data);
|
||||
// controller.enqueue(`event: modification\n`);
|
||||
// controller.enqueue(`data: ${JSON.stringify(data)}\n\n`);
|
||||
// });
|
||||
// // Close the controller when the client closes the connection
|
||||
// request.signal.addEventListener('abort', () => {
|
||||
// controller.close();
|
||||
// });
|
||||
// },
|
||||
// }), {
|
||||
// status: 200,
|
||||
// headers: {
|
||||
// 'Content-Type': 'text/event-stream',
|
||||
// 'Cache-Control': 'no-cache',
|
||||
// Connection: 'keep-alive',
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// export async function POST(request: Request) {
|
||||
// console.log('POST request received');
|
||||
// const data = await request.json();
|
||||
// console.log('Data received:', data);
|
||||
// eventEmitter.emit('modification', data);
|
||||
// return new Response('Event sent', { status: 200 });
|
||||
// }
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
export const eventEmitter = new EventEmitter();
|
||||
|
||||
Reference in New Issue
Block a user