lien editor -> live editor

pull/5/head
Bastien OLLIER 11 months ago committed by clfreville2
parent 85e5d9257e
commit e24ccfe90f

@ -106,10 +106,26 @@ fastify.register(async function (fastify: Fastify) {
})
/* Route pour créer une room */
fastify.post(
"/live",
async (request, reply) => {
return generateId();
fastify.post("/live", {
schema: {
body: Type.Object({
code: Type.String(),
}),
},
}, (request, reply) => {
const { code } = request.body;
let roomId = generateId();
let room = rooms[roomId];
if(!room){
room = {
sockets: [],
updates: [],
doc: Text.of([code])
};
rooms[roomId] = room;
}
return roomId;
},
);

Loading…
Cancel
Save