
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@blued-core/http-server
Advanced tools
基于 routing-controller
的简易封装,抽出了一些复用的逻辑。
npx install-peerdeps @blued-core/http-server
import { createServer } from '@blued-core/http-server'
createServer({
logPath: './log',
exceptionReportUrl: 'sentry.xxx.com',
performanceConfig: {
host: '0.0.0.1',
port: 12345,
group: 'test',
project: 'test-project'
},
port: 1234
})
// 具体的 router 实现
import { JsonController, Get } from '@blued-core/http-server'
@JsonController('/test')
export default class {
@Get('/patha')
get () {
return 'Hello World'
}
}
// curl http://127.0.0.1:1234/test/patha
如果请求 Header 携带 Content-Type: application/json 则会主动拼接参数,类似
{ code: 200, data: 'Hello World' }
主要文档基于:http-server-base
option | type | default | desc |
---|---|---|---|
logPath | string | - | 设置 log 输出的路径 |
exceptionReportUrl | string | - | 设置异常监控上报的路径 |
performanceConfig | Object | - | 设置性能监控上报的配置 |
option | type | desc |
---|---|---|
host | string | 配置的 IP |
port | number | 端口号 |
group | string | 上报数据所属分组 |
project | string | 上报数据所属项目 |
FAQs
基于 `routing-controller` 的简易封装,抽出了一些复用的逻辑。
We found that @blued-core/http-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.