ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Nest.js] 1 - Basic Structure
    Nest.js 2021. 9. 7. 18:14

    Content
    1. Structure


    1. Structure

    initial files

    • src : consist of business logics
      • main.ts : create application and run
        import { NestFactory } from '@nestjs/core';
        import { AppModule } from './app.module';
        
        async function bootstrap() {
          const app = await NestFactory.create(AppModule); // AppModule is Root 
          await app.listen(3000);
        }
        
        bootstrap();​
      • app.module.ts : define app module, it roles as a root module which combines other modules.
        import { Module } from '@nestjs/common';
        import { AppController } from './app.controller';
        import { AppService } from './app.service';
        
        @Module({
          imports: [],
          controllers: [AppController],
          providers: [AppService],
        })
        export class AppModule {}​
      • XXX.spec.ts : codes for unit-test
    • test : consist of end to end test files
      • XXX.e2e-spec.ts : codes for e2e test
    • eslintrc.js : a library which helps developers have regulations to write codes
                         , a guideline of typescript, and a inspector for syntax errors
    • prettierrc : formatter for ' or " and indentation.
    • nest-cli.json : settings of a project, such as sourceRoot
    • tsconfig.json : settings how typescripts complie
    • ts.config.build.json : extension of tsconfig.json, settings for build, such as excludes not essential files
    • package.json : shows cli keywords, package's version

    'Nest.js' 카테고리의 다른 글

    [Nest.js] 5 - TypeORM / MySql(MariaDB)  (0) 2021.09.08
    [Nest.js] 4 - Provider  (0) 2021.09.08
    [Nest.js] 3 - Controller  (0) 2021.09.08
    [Nest.js] 2 - Module  (0) 2021.09.07
    [Nest.js] 0 - Nest.js ?  (0) 2021.09.07
Designed by Tistory.