generator-nest-js-boilerplate
Version:
This generator will help you to build your own Nest.js Mongodb API using TypeScript 4
28 lines (26 loc) • 625 B
text/typescript
import * as fs from 'fs';
import {
Controller,
Get,
Res,
} from '@nestjs/common';
import { ApiTags, ApiOkResponse } from '@nestjs/swagger';
import { Response as ExpressResponse } from 'express';
('App')
()
export default class AppController {
({
type: Buffer,
description: 'returns a favicon',
})
('favicon.ico')
async getFavicon(() res: ExpressResponse) {
fs.createReadStream(`${__dirname}/../../../public/favicon.png`)
.on('data', (chunk: Buffer) => {
res.write(chunk);
})
.on('close', () => {
res.end();
});
}
}