Skip to content

AlonsoErnesto/Template_NestJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nestia-example

npm run start:local
# .env
DB_TYPE=
LOCAL_DB_HOST=
LOCAL_DB_PORT=
LOCAL_DB_USERNAME=
LOCAL_DB_DATABASE=
LOCAL_DB_PASSWORD=

TEST_DB_HOST=
TEST_DB_PORT=
TEST_DB_USERNAME=
TEST_DB_DATABASE=
TEST_DB_PASSWORD=

Testing on Nestia

npm run test:watch

Swagger

npm run build
   # npm run prebuild  : rimraf dist
   # npm run build     : nest build
   # npm run postbuild : npx nestia swagger && npx nestia sdk

SDK

npm run build
   # npm run prebuild  : rimraf dist
   # npm run build     : nest build
   # npm run postbuild : npx nestia swagger && npx nestia sdk

npm run publish # cd packages/api/lib && npm publish
  1. npx nestia sdk
  2. packages/api/lib/package.json

SDK

import * as Apis from 'picktogram-server-apis/api/functional';

try {
  const connection = {
    host: SERVER_URL,
    headers: {
      Authorization: token,
      'Content-Type': 'application/json',
    },
  };

  // /api/v1/articles/reports 경로의 report()

  const response = await Apis.api.v1.articles.reports.report(connection, articleId, {
    reason: '불쾌한 언행으로 인한 신고',
  });
  return response.data;
} catch (err) {
  throw err;
}

About

NestJS - RestFul - Swagger - Nestia - Pino

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published