Skip to content

Commit

Permalink
refactor: names
Browse files Browse the repository at this point in the history
  • Loading branch information
MaurerKrisztian committed Nov 24, 2022
1 parent 892edf1 commit c49735e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion example/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {ValidationPipe} from "../lib/services/pipe/validation.pipe";
import { LogMiddleware } from "./middlewares/log.middleware";
import express from 'express';
import * as path from "path";
import { Env } from "../lib";

async function main() {
const port = process.env.PORT || 3001;
const port = Env.asNumber("PORT", 3000);


const app = express()
Expand Down
11 changes: 8 additions & 3 deletions example/controllers/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { Param } from '../../lib/decorators/param.decorator';
import { FooService } from '../services/foo.service';
import { UpperCasePipe } from '../services/upper.pipe';
import { Get } from '../../lib/decorators/method/get.decorator';
import { Controller, Post } from "../../lib";
import { Controller, HttpError, Post } from "../../lib";
import { OtherValidator, UserValidator } from "../user.validator";
import { ApiDocs } from "../../lib/decorators/openapi/result.decorator";
import { NotImplementedError } from "../../lib/error/http/specific-http.error";
import { NotImplementedError } from "../../lib/error/http/bad-request.error";
import { LogMiddleware2, LogMiddleware3 } from "../middlewares/log.middleware";
import { BeforeMiddleware } from "../../lib/decorators/middleware/before-middleware.decorator";
import { AfterMiddleware } from "../../lib/decorators/middleware/after-middleware.decorator";
Expand All @@ -30,7 +30,12 @@ export class UserController {
return {test:"123"}
}

@ApiDocs({resultType: UserValidator, summary: "custom summary", description: "this is my description", tags: ["ttttttttttttttt"]})
@ApiDocs({
resultType: UserValidator,
summary: "custom summary",
description: "this is my description",
tags: ["user"]
})
@Get('/test')
async getUsers(
@Req() req: Request,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpError } from './http-error';

export class SpecificHttpError extends HttpError {
export class BadRequestError extends HttpError {
constructor(message: string, details?: any) {
super(400, message, details);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export * from './decorators/method/post.decorator';
export * from './decorators/controller.decorator';
export * from './env/env';
export * from './error/http/http-error';
export * from './error/http/specific-http.error';
export * from './error/http/bad-request.error';
export * from './error/http/status-map';
export * from 'type-chef-di';
export { Request, Response, Express, Application } from 'express';
Expand Down

0 comments on commit c49735e

Please sign in to comment.