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
b877dc54
Commit
b877dc54
authored
3 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
added vip routes
parent
2d5e8b31
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
deploy/app.js
+9
-16
9 additions, 16 deletions
deploy/app.js
deploy/saneUrl/index.js
+3
-0
3 additions, 0 deletions
deploy/saneUrl/index.js
docs/releases/v2.6.5.md
+1
-0
1 addition, 0 deletions
docs/releases/v2.6.5.md
with
13 additions
and
16 deletions
deploy/app.js
+
9
−
16
View file @
b877dc54
...
@@ -7,20 +7,12 @@ const crypto = require('crypto')
...
@@ -7,20 +7,12 @@ const crypto = require('crypto')
const
cookieParser
=
require
(
'
cookie-parser
'
)
const
cookieParser
=
require
(
'
cookie-parser
'
)
const
bkwdMdl
=
require
(
'
./bkwdCompat
'
)()
const
bkwdMdl
=
require
(
'
./bkwdCompat
'
)()
const
deprecated
=
(
_req
,
res
)
=>
res
.
status
(
410
).
end
()
const
LOCAL_CDN_FLAG
=
!!
process
.
env
.
PRECOMPUTED_SERVER
const
LOCAL_CDN_FLAG
=
!!
process
.
env
.
PRECOMPUTED_SERVER
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
app
.
use
(
require
(
'
cors
'
)())
app
.
use
(
require
(
'
cors
'
)())
}
}
const
DOC_PUBLIC_PATH
=
process
.
env
.
NODE_ENV
===
'
production
'
?
path
.
join
(
__dirname
,
'
docs
'
)
:
path
.
join
(
__dirname
,
'
..
'
,
'
site
'
)
app
.
use
(
'
/docs
'
,
express
.
static
(
DOC_PUBLIC_PATH
))
app
.
use
(
'
/quickstart
'
,
require
(
'
./quickstart
'
))
app
.
use
(
'
/quickstart
'
,
require
(
'
./quickstart
'
))
const
hash
=
string
=>
crypto
.
createHash
(
'
sha256
'
).
update
(
string
).
digest
(
'
hex
'
)
const
hash
=
string
=>
crypto
.
createHash
(
'
sha256
'
).
update
(
string
).
digest
(
'
hex
'
)
...
@@ -28,7 +20,7 @@ const hash = string => crypto.createHash('sha256').update(string).digest('hex')
...
@@ -28,7 +20,7 @@ const hash = string => crypto.createHash('sha256').update(string).digest('hex')
app
.
use
((
req
,
_
,
next
)
=>
{
app
.
use
((
req
,
_
,
next
)
=>
{
if
(
/main
\.
bundle
\.
js$/
.
test
(
req
.
originalUrl
)){
if
(
/main
\.
bundle
\.
js$/
.
test
(
req
.
originalUrl
)){
const
xForwardedFor
=
req
.
headers
[
'
x-forwarded-for
'
]
const
xForwardedFor
=
req
.
headers
[
'
x-forwarded-for
'
]
const
ip
=
req
.
connection
.
remoteAddress
const
ip
=
req
.
socket
.
remoteAddress
console
.
log
({
console
.
log
({
type
:
'
visitorLog
'
,
type
:
'
visitorLog
'
,
method
:
'
main.bundle.js
'
,
method
:
'
main.bundle.js
'
,
...
@@ -107,8 +99,15 @@ const _ = (async () => {
...
@@ -107,8 +99,15 @@ const _ = (async () => {
/**
/**
* saneUrl end points
* saneUrl end points
*/
*/
const
{
router
:
saneUrlRouter
}
=
require
(
'
./saneUrl
'
)
const
{
router
:
saneUrlRouter
,
vipRoutes
}
=
require
(
'
./saneUrl
'
)
app
.
use
(
'
/saneUrl
'
,
saneUrlRouter
)
app
.
use
(
'
/saneUrl
'
,
saneUrlRouter
)
app
.
use
(
'
/go
'
,
saneUrlRouter
)
const
HOST_PATHNAME
=
process
.
env
.
HOST_PATHNAME
||
''
for
(
const
route
of
vipRoutes
)
{
app
.
get
(
route
,
(
req
,
res
)
=>
res
.
redirect
(
`
${
HOST_PATHNAME
}
/go/
${
route
}
`
))
}
})()
})()
const
PUBLIC_PATH
=
process
.
env
.
NODE_ENV
===
'
production
'
const
PUBLIC_PATH
=
process
.
env
.
NODE_ENV
===
'
production
'
...
@@ -230,13 +229,7 @@ const jsonMiddleware = (req, res, next) => {
...
@@ -230,13 +229,7 @@ const jsonMiddleware = (req, res, next) => {
*/
*/
const
pluginRouter
=
require
(
'
./plugins
'
)
const
pluginRouter
=
require
(
'
./plugins
'
)
app
.
use
(
'
/atlases
'
,
deprecated
)
app
.
use
(
'
/templates
'
,
deprecated
)
app
.
use
(
'
/nehubaConfig
'
,
deprecated
)
app
.
use
(
'
/datasets
'
,
deprecated
)
app
.
use
(
'
/regionalFeatures
'
,
deprecated
)
app
.
use
(
'
/plugins
'
,
jsonMiddleware
,
pluginRouter
)
app
.
use
(
'
/plugins
'
,
jsonMiddleware
,
pluginRouter
)
app
.
use
(
'
/preview
'
,
deprecated
)
const
catchError
=
require
(
'
./catchError
'
)
const
catchError
=
require
(
'
./catchError
'
)
app
.
use
(
catchError
)
app
.
use
(
catchError
)
...
...
This diff is collapsed.
Click to expand it.
deploy/saneUrl/index.js
+
3
−
0
View file @
b877dc54
...
@@ -108,7 +108,10 @@ const ready = async () => {
...
@@ -108,7 +108,10 @@ const ready = async () => {
return
await
store
.
healthCheck
()
return
await
store
.
healthCheck
()
}
}
const
vipRoutes
=
[
"
human
"
,
"
monkey
"
,
"
rat
"
,
"
mouse
"
]
module
.
exports
=
{
module
.
exports
=
{
router
,
router
,
ready
,
ready
,
vipRoutes
,
}
}
This diff is collapsed.
Click to expand it.
docs/releases/v2.6.5.md
+
1
−
0
View file @
b877dc54
...
@@ -4,3 +4,4 @@
...
@@ -4,3 +4,4 @@
-
Re-enabled autoradiographs for receptor datasets
-
Re-enabled autoradiographs for receptor datasets
-
Added how-to-cite as a part of quick tour (#1085)
-
Added how-to-cite as a part of quick tour (#1085)
-
Added VIP routes
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