
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
强烈推荐作为项目的一个开发依赖来使用, 这样, 你的bird配置已经整体的开发工具链, 都可以作为项目的一部分提交到代码中, 方便后续人员开发时使用
cd my-project-folder
npm install --save birdv3
推荐在你的项目中创建一个 bird/
文件夹, 里面的结构如下:
bird/
|-- birdfile.js
|-- bird-server.js
其中, birdfile.js 为你的bird配置文件, 它的格式可以参照下面的 bird config
bird-server.js 很简单, 为:
var bird = require('birdv3')
bird('./birdfile.js')
当然, bird也还是作为全局的命令使用, 但不推荐
npm install -g birdv3
bird ./some/path/to/birdfile.js
bird也支持中间件使用, 与开发依赖安装类似, 你需要有一个 birdfile.js, 然后在你的server脚本中, 加入以下的代码:
注意!! 最好把bird放置在所有其他的中间件或request handler后面
var bird = require('birdv3')
...
// 假设 app 是一个 express 服务器对象
app.all('*', bird('./path/to/birdfile.js'))
...
bird还可以将从服务器取回的数据上报,然后接口平台可以帮你生成可视化的接口文档
project/locals/lib/
下面index.js
=> project/locals/lib/index.js
bin/bird.js
当前的开发方向如下:
注意: 以下的README内容为 birdv2 的范围, 请随时关注项目的开发
var config = {
name: 'ar',
bird_port: 7676,
staticFileRootDirPath: '../webapp',
server: 'http://xx.xx.com:8901/ar/',
uuap_server: 'http://xx.xx.com:8100',
username: 'jay',
password_suffix: ''
};
`or`
var config = [{
name: 'ar',
bird_port: 7676,
staticFileRootDirPath: '../webapp',
server: 'http://xx.xx.com:8901/ar/',
uuap_server: 'http://xx.xx.com:8100',
username: 'jay',
password_suffix: ''
}, {
name: 'ar2',
bird_port: 7777,
staticFileRootDirPath: '../webapp',
server: 'http://xx.xx.com:8902/ar/',
uuap_server: 'http://xx.xx.com:82S00',
username: 'jay',
password_suffix: ''
}]
// *服务名字,本配制以ar为例
name: 'ar',
// *服务端口
bird_port: 3000,
// *静态文件目录,可以为相对路径,如:../build
staticFileRootDirPath: '/home/zp/work/ar/src/main/webapp/resources',
// *测试机地址,是否带`ar`看环境的context
server: 'http://xx-xx.epc:8901/ar/',
// *该测试机对应的uuap地址
uuap_server: 'http://uuap_test.com:8100',
// *你想用谁登录
username: 'who_you_want',
// *密码后缀,没有就留空
password_suffix: '',
// 是否开启dev-tools(提供切换用户等功能)default:false
dev_tool: {
type: 'input', // #暂时只有这一个,后续加select
top: 20, // 工具上边距
right: 20 //右边距
},
// feapps专用登录,hard code this one. default:false
bprouting: 'bprouting/BpFlowRouting?appindex=true',
// 是否使用静态的cookie,录bird出问题了你还可以把cookie粘到这里,像旧版一样default:false
cookie: 'sessionid=XXXXXXXXXXX',
// 转发路由,你可以将本地的请求转发到指定的路径
router: {
'/ar': '/ar-web' // 将http://xx-xx.epc:8901/ar/XX/XX -> http://xx-xx.epc:8901/ar-web/XX/XX
},
// 登录方式,默认是使用uuap来登录,加载auths/uuap.js default:'uuap'
auth_standalone: 'uuap',
// #当cookie效了重新cookie,当然,你可以重启bird来手动获取.default:true
keep_alive: true,
// #使用本地的数据,不转发. 当服务器当了,你可以造些假数据来本地测试
use_local_data: {
'/ar': '/your/data/path'
}
FAQs
birdv3 is a proxy server with cas auth built in, originate from `bird`
The npm package birdv3 receives a total of 45 weekly downloads. As such, birdv3 popularity was classified as not popular.
We found that birdv3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.