Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteaaa5ef

Browse files
committed
User agent in the request
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent3f51b79 commiteaaa5ef

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

‎lib/cube.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const pusage = require('pidusage')
33
constgot=require('got')
44

55
classCube{
6-
constructor(key,options){
6+
constructor(apiKey,options){
77
this.url='https://api.labstack.com/cube'
8-
this.key=key
8+
this.apiKey=apiKey
99
options=options||{}
1010
this.node=options.node||os.hostname()
1111
this.batchSize=options.batchSize||60
@@ -37,7 +37,8 @@ class Cube {
3737
// TODO: handler error
3838
got.post(this.url,{
3939
headers:{
40-
'Authorization':`Bearer${this.key}`
40+
'User-Agent':'labstack/cube',
41+
'Authorization':`Bearer${this.apiKey}`
4142
},
4243
body:this.requests,
4344
json:true

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"labstack",
3-
"version":"0.21.1",
3+
"version":"0.21.2",
44
"description":"Official Node.js client library for the LabStack platform",
55
"main":"lib/index.js",
66
"scripts": {

‎test/express.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ app.use((err, req, res, next) => {
1717
next(err)
1818
})
1919

20-
app.listen(3001,()=>console.log('Example app listening on port 3001!'))
20+
app.listen(3001)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp