컴퓨터를 켰을 때, 가장 먼저 실행되는 프로그램은 부트스트랩[Boot stap] 프로그램이다. 부트스트랩은 ROM이나 EPROM 등의 펌웨어[Firmware]에 저장된다. 부트스트랩이 실행되면서 시스템의 모든 기능을 초기화 하고 운영체제의 커널을 메모리에 로딩하고 실행을 하면서 컴퓨터가 켜진다. 이 과정을 step by step로 설명해보겠다. 전원이 켜진다. CPU가 ROM 안에 BIOS를 찾고 실행을 한다. BIOS는 HW가 이상이 없는지 체크하고 초기화를 한다. CPU는 전원이 들어오면 메모리에 0x0000번째 명령어를 실행하고 순차적으로 0x0001번째 명령어를 실행한다. 하지만, RAM은 휘발성 메모리이기 때문에 전원이 꺼지면 메모리에 아무것도 없다. 그 뜻은 CPU는 전원이 들어온 시점에 0x..
리스트 : 콘텐츠가 있으면 최근 5건을 불러옵니다.
-
Presigned URL을 이용하여 이미지 업로드할 때 용량 제한하기S3 2022.04.20 17:41
백엔드(NestJS) import AWS from 'aws-sdk'; import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { ConfigType } from '@nestjs/config'; import { GetPreSignedUrlQueryDTO, GetPreSignedUrlResDTO } from '@dtos'; import AwsConfig from '@config/variables/aws.config'; @Injectable() export class UploadService { constructor( @Inject(AwsConfig.KEY) private readonly awsConfig: ConfigT..
-
NestJS Custom repositoryE-commerce App 2021.09.04 08:47
개요 TypeORM의 Custom Repository를 이용해서 Active Recorder에 없는 method를 추가할 것이다. categories/repositories/category.repository.ts import { EntityRepository, Repository } from 'typeorm'; import { Category } from '../entities/category.entity'; @EntityRepository(Category) export class CategoryRepository extends Repository { async findOneBySlugUsingName(name: string) { const categoryName = name.trim().toLower..
-
slug를 이용해서 category search 하기E-commerce App 2021.09.04 08:36
개요 Slug는 web 주소의 고유 식별 부분이다. 보통 URL의 끝부분이다. 내 주소에서는 baseURL(clownhacker.tistory.com/)의 뒷 부분인 번호다. 카테고리에 있는 품목 리스트를 출력하기 위해서 카테고리 slug 값이 필요하다. 카테고리 slug 값은 카테고리 name을 processed 한 것이다. categories.service.ts async createCategory({ name, coverImg, }: CreateCategoryInput): Promise { try { const categoryName = name.trim().toLowerCase(); const categorySlug = categoryName.replace(/ /g, '-'); const cate..
-
TypeORM의 @ManyToOne과 @OneToManyE-commerce App 2021.09.03 17:38
개요 TypeORM은 관계형 ORM이다. 각각의 인스턴스가 서로를 참조할 수 있다. product.entity.ts import { Field, InputType, ObjectType } from '@nestjs/graphql'; import { IsString } from 'class-validator'; import { Column, Entity, ManyToOne } from 'typeorm'; import { CoreEntity } from 'src/common/entities/common.entity'; import { Category } from 'src/categories/entities/category.entity'; @InputType('ProductInputType', { isAbstr..
-
nestJS에서 DTO에서 쓰는 PartialType and PickType을 같이 쓸 때 주의할 점E-commerce App 2021.09.03 16:39
product.entity.ts import { Field, InputType, Int, ObjectType } from '@nestjs/graphql'; import { IsNumber, IsString } from 'class-validator'; import { Column, Entity, ManyToOne } from 'typeorm'; import { CoreEntity } from 'src/common/entities/common.entity'; import { User } from 'src/users/entities/user.entity'; import { Category } from 'src/categories/entities/category.entity'; @InputType('InfoI..