# think_trace

> HTTP error intercept processing for ThinkKoa.

Latest version **3.4.0** (published 2020-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install think_trace
pnpm add think_trace
yarn add think_trace
bun add think_trace
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2020-11-09 |
| First published | 2017-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >8.0.0 |
| Dependencies | 2 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | richenlin |
| Maintainers | richenlin |

## Links

- npm: https://www.npmjs.com/package/think_trace
- Homepage: https://github.com/thinkkoa/think_trace
- Issues: https://github.com/thinkkoa/think_trace/issues
- npm.io page: https://npm.io/package/think_trace

## Dependencies (2)

- [think_lib](https://npm.io/package/think_lib.md) ^2.x.x
- [think_logger](https://npm.io/package/think_logger.md) ^2.x.x

## Recent versions

- 3.4.0 (latest) — 2020-11-09
- 3.3.4 — 2020-11-06
- 3.3.3 — 2020-10-29
- 3.3.2 — 2020-10-29
- 3.3.1 — 2020-10-28
- 3.3.0 — 2020-10-28
- 3.2.0 — 2020-08-19
- 3.1.0 — 2020-05-11
- 3.0.4 — 2020-05-10
- 3.0.3 — 2020-05-10
- 3.0.2 — 2020-05-09
- 3.0.1 — 2020-05-09
- 3.0.0 — 2020-05-09
- 2.2.0 — 2020-04-13
- 2.1.4 — 2020-03-05
- … 18 more at https://npm.io/package/think_trace/versions

## README

# 介绍
-----

[![npm version](https://badge.fury.io/js/think_trace.svg)](https://badge.fury.io/js/think_trace)

HTTP error intercept processing for ThinkKoa.

# 安装
-----

```
npm i think_trace
```

# 使用
-----

1、trace中间件为thinkkoa内置中间件,无需在项目中创建引用。该中间件默认开启

2、项目中间件配置 config/middleware.js:
```
config: { //中间件配置
    ...,
    trace: {
        timeout: 10, //http服务超时时间,单位s
        error_code: 500, //发生错误输出的状态码
        error_path: '', //错误模板目录配置.该目录下放置404.html、502.html等,框架会自动根据status进行渲染(支持模板变量,依赖think_view中间件;如果think_view中间件未加载,仅输出模板内容)
    }
}
```

---
_Source: https://npm.io/package/think_trace · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
