api generate - wwwsolutions/nestjs-starter-kit GitHub Wiki

api

Implement and utilize app.

Features

  • api integrations

Generate

// generate app
yarn add -D @nrwl/nest
yarn nx generate @nrwl/nest:application --name=api --standaloneConfig --tags=type:api --no-interactive

Remove files

// apps/api/src/app/app.controller.ts
// apps/api/src/app/app.controller.spec.ts
// apps/api/src/app/app.service.ts
// apps/api/src/app/app.service.spec.ts
// .gitkeep

Create

app-module.ts

// apps/api/src/app/app-module.ts

import { Module } from '@nestjs/common';

import { ApiCoreModule } from '@wwwsolutions/api/core';

@Module({
  imports: [ApiCoreModule],
})
export class AppModule {}

main.ts

// apps/api/src/main.ts

.env.local

// apps/api/.env.local

.env.development

// apps/api/.env.development

# DEVELOPMENT MODE

##### WINSTON CONFIGURATION ############################################################################

### REQUIRED
WINSTON_LEVEL_CONSOLE='verbose'
WINSTON_PRETTY_PRINT=true
WINSTON_LEVEL_FILE='silly'
WINSTON_FILE_PATH='logs/app.log'


##### API CONFIGURATION ################################################################################

### REQUIRED
API_INTEGRATION='ApiGraphqlPrismaIntegration'

### OPTIONAL
# API_TYPE='GraphqlApi'
# API_PROTOCOL='http'
# API_HOST='localhost'
# API_PORT=3000
# API_PREFIX='graphql'

.env.production

// apps/api/.env.production

.env.staging

// apps/api/.env.staging

.env.test

// apps/api/.env.test

.env.example

// apps/api/.env.test

⚠️ **GitHub.com Fallback** ⚠️