lien editor -> live editor
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details

Bastien OLLIER 11 months ago
parent fc6cbadebb
commit 92b0197c4a

@ -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