cc-core-cli
Version:
Command Line Interface tool for generating project templates for the (Your Platform's Name) platform.
19 lines (15 loc) • 510 B
text/typescript
import { Controller, Get, Param } from "@nestjs/common";
import { AttachmentService } from "@shopstack/cc-core-lib/core";
("private")
export class StoragePrivateController {
constructor(private readonly attachment: AttachmentService) {}
("/*")
getMedia(() params: any): any {
const filename = params["*"]
.split("/")
.slice(-1)
.toString();
const path = params["*"].replace(`/${filename}`, "");
return this.attachment.download(path, filename);
}
}