Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
ae72d682
Unverified
Commit
ae72d682
authored
1 year ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
hotfix: remove request
parent
a3d3e054
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
deploy/app.js
+4
-1
4 additions, 1 deletion
deploy/app.js
deploy/logging/index.js
+5
-13
5 additions, 13 deletions
deploy/logging/index.js
deploy/saneUrl/depcObjStore.js
+2
-9
2 additions, 9 deletions
deploy/saneUrl/depcObjStore.js
deploy/saneUrl/store.js
+10
-23
10 additions, 23 deletions
deploy/saneUrl/store.js
with
21 additions
and
46 deletions
deploy/app.js
+
4
−
1
View file @
ae72d682
...
...
@@ -94,7 +94,10 @@ const _ = (async () => {
}))
await
configureAuth
(
app
)
app
.
use
(
'
/user
'
,
require
(
'
./user
'
))
/**
* TODO fix user import
*/
// app.use('/user', require('./user'))
/**
* saneUrl end points
...
...
This diff is collapsed.
Click to expand it.
deploy/logging/index.js
+
5
−
13
View file @
ae72d682
const
reques
t
=
require
(
'
reques
t
'
)
const
go
t
=
require
(
'
go
t
'
)
const
qs
=
require
(
'
querystring
'
)
class
Logger
{
...
...
@@ -11,7 +11,7 @@ class Logger {
this
.
password
=
password
}
emit
(
logLevel
,
message
,
callback
){
async
emit
(
logLevel
,
message
,
callback
){
const
{
name
,
protocol
,
...
...
@@ -26,17 +26,9 @@ class Logger {
const
formData
=
{
json
:
JSON
.
stringify
(
message
)
}
if
(
callback
)
{
request
.
post
({
url
,
formData
},
callback
)
}
else
{
return
request
.
post
({
url
,
formData
})
}
await
got
.
post
(
url
,
{
formData
})
}
}
...
...
This diff is collapsed.
Click to expand it.
deploy/saneUrl/depcObjStore.js
+
2
−
9
View file @
ae72d682
const
reques
t
=
require
(
'
reques
t
'
)
const
go
t
=
require
(
'
go
t
'
)
const
{
NotFoundError
}
=
require
(
'
./store
'
)
const
{
OBJ_STORAGE_ROOT_URL
}
=
process
.
env
...
...
@@ -11,14 +11,7 @@ class Store {
new
NotFoundError
()
)
}
return
new
Promise
((
rs
,
rj
)
=>
{
request
.
get
(
`
${
OBJ_STORAGE_ROOT_URL
}
/
${
id
}
`
,
(
err
,
resp
,
body
)
=>
{
if
(
err
)
return
rj
(
err
)
if
(
resp
.
statusCode
===
404
)
return
rj
(
new
NotFoundError
())
if
(
resp
.
statusCode
>=
400
)
return
rj
(
resp
)
return
rs
(
body
)
})
})
return
got
(
`
${
OBJ_STORAGE_ROOT_URL
}
/
${
id
}
`
).
text
()
}
async
del
(
id
){
...
...
This diff is collapsed.
Click to expand it.
deploy/saneUrl/store.js
+
10
−
23
View file @
ae72d682
const
reques
t
=
require
(
'
reques
t
'
)
const
go
t
=
require
(
'
go
t
'
)
const
apiPath
=
'
/api/v4
'
const
saneUrlVer
=
`0.0.1`
...
...
@@ -31,31 +31,18 @@ class GitlabSnippetStore {
}
_promiseRequest
(...
arg
)
{
return
new
Promise
((
rs
,
rj
)
=>
{
request
(...
arg
,
(
err
,
resp
,
body
)
=>
{
if
(
err
)
return
rj
(
err
)
if
(
resp
.
statusCode
>=
400
)
return
rj
(
resp
)
rs
(
body
)
})
})
return
got
(...
arg
).
text
()
}
_request
({
addPath
=
''
,
method
=
'
GET
'
,
headers
=
{},
opt
=
{}
}
=
{})
{
return
new
Promise
((
rs
,
rj
)
=>
{
request
(
`
${
this
.
url
}${
addPath
}
`
,
{
method
,
headers
:
{
'
PRIVATE-TOKEN
'
:
this
.
token
,
...
headers
},
qs
:
{
per_page
:
1000
},
...
opt
},
(
err
,
resp
,
body
)
=>
{
if
(
err
)
return
rj
(
err
)
if
(
resp
.
statusCode
>=
400
)
return
rj
(
resp
)
return
rs
(
body
)
})
})
return
got
(
`
${
this
.
url
}${
addPath
}
?per_page=1000`
,
{
method
,
headers
:
{
'
PRIVATE-TOKEN
'
:
this
.
token
,
...
headers
},
...
opt
}).
text
()
}
async
get
(
id
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment