feat: add support for collabs room

This commit is contained in:
Kilian Decaderincourt
2021-11-26 19:35:45 +01:00
parent 3fcd00e9ca
commit 6b525d0f64
7 changed files with 81 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import {
Header,
InternalServerErrorException,
Logger,
NotFoundException,
Param,
Post,
Res,
@ -14,7 +15,7 @@ import { StorageNamespace, StorageService } from 'src/storage/storage.service';
import { Readable } from 'stream';
import { customAlphabet } from 'nanoid';
@Controller()
@Controller('scenes')
export class ScenesController {
private readonly logger = new Logger(ScenesController.name);
namespace = StorageNamespace.SCENES;
@ -26,6 +27,10 @@ export class ScenesController {
const data = await this.storageService.get(params.id, this.namespace);
this.logger.debug(`Get scene ${params.id}`);
if (!data) {
throw new NotFoundException();
}
const stream = new Readable();
stream.push(data);
stream.push(null);