• Decorator for DELETE endpoints

    Parameters

    • path: string

      The route path

    Returns ((target, propertyKey, descriptor) => PropertyDescriptor)

      • (target, propertyKey, descriptor): PropertyDescriptor
      • Parameters

        • target: any
        • propertyKey: string
        • descriptor: PropertyDescriptor

        Returns PropertyDescriptor

    Example

    @del("/api/users/:id")
    async deleteUser(req: KosRequest<"/api/users/:id">, res: KosResponse) {
    const userId = req.params.id;
    await this.userService.deleteUser(userId);
    res.status(204).send();
    }