𝒟𝒩
Size: a a a
𝒟𝒩
𝒟𝒩
𝒟𝒩
KA
𝒟𝒩
KA
𝒟𝒩
𝒟𝒩
𝒟𝒩
KA
class BaseCrudClass {
constructor(protected model: Model<Document>){
}
create(){}
findOne(){}
findList(){}
update(){}
delete(){}
}
@Component()
class MyEntityService extends BaseCrudClass {
constructor(@Inject(MY_ENTITY_TOKEN) private readonly entityModel: mongoose.Model<MyEntity>){
super(entityModel)
}
}
KA
𝒟𝒩
𝒟𝒩
KA
const STATIC_ROOT = normalize(join(__dirname, '..', 'web', 'public'));
const ADMIN_ROOT = normalize(join(__dirname, '..', 'web', 'admin'));
const ASSETS_ROOT = normalize(join(__dirname, '..', 'web', 'assets'));
const server = express();
const app = await NestFactory.create(ApplicationModule, server);
server.use('/assets', express.static(ASSETS_ROOT));
server.use('/admin', express.static(ADMIN_ROOT));
server.use(express.static(STATIC_ROOT));
E
const STATIC_ROOT = normalize(join(__dirname, '..', 'web', 'public'));
const ADMIN_ROOT = normalize(join(__dirname, '..', 'web', 'admin'));
const ASSETS_ROOT = normalize(join(__dirname, '..', 'web', 'assets'));
const server = express();
const app = await NestFactory.create(ApplicationModule, server);
server.use('/assets', express.static(ASSETS_ROOT));
server.use('/admin', express.static(ADMIN_ROOT));
server.use(express.static(STATIC_ROOT));
KA
АД
const STATIC_ROOT = normalize(join(__dirname, '..', 'web', 'public'));
const ADMIN_ROOT = normalize(join(__dirname, '..', 'web', 'admin'));
const ASSETS_ROOT = normalize(join(__dirname, '..', 'web', 'assets'));
const server = express();
const app = await NestFactory.create(ApplicationModule, server);
server.use('/assets', express.static(ASSETS_ROOT));
server.use('/admin', express.static(ADMIN_ROOT));
server.use(express.static(STATIC_ROOT));
const app = await NestFactory.create(ApplicationModule);
app.use('/assets', express.static(ASSETS_ROOT));
KA
KA
АД
import { Middleware, NestMiddleware, ExpressMiddleware } from '@nestjs/common';
@Middleware()
export class LoggerMiddleware implements NestMiddleware {
resolve(...args: any[]): ExpressMiddleware {
return (req, res, next) => {
console.log('Request...');
next();
};
}
}