Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
334721eb
Commit
334721eb
authored
13 years ago
by
Pete Fritchman
Committed by
Lloyd Hilaiel
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add /__heartbeat__ endpoint for load balancers - remove ping.txt - closes #481
parent
c03fa0ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
browserid/app.js
+5
-4
5 additions, 4 deletions
browserid/app.js
browserid/static/ping.txt
+0
-0
0 additions, 0 deletions
browserid/static/ping.txt
libs/heartbeat.js
+7
-0
7 additions, 0 deletions
libs/heartbeat.js
verifier/app.js
+9
-12
9 additions, 12 deletions
verifier/app.js
with
21 additions
and
16 deletions
browserid/app.js
+
5
−
4
View file @
334721eb
...
...
@@ -45,6 +45,7 @@ express = require('express'),
secrets
=
require
(
'
../libs/secrets.js
'
),
db
=
require
(
'
./lib/db.js
'
),
configuration
=
require
(
'
../libs/configuration.js
'
),
heartbeat
=
require
(
'
../libs/heartbeat.js
'
),
substitution
=
require
(
'
../libs/substitute.js
'
);
metrics
=
require
(
"
../libs/metrics.js
"
),
logger
=
require
(
"
../libs/logging.js
"
).
logger
;
...
...
@@ -102,9 +103,6 @@ function router(app) {
res
.
render
(
'
index.ejs
'
,
{
title
:
'
A Better Way to Sign In
'
,
fullpage
:
true
});
});
// BA removed .html URLs. If we have 404s,
// we should set up some redirects
app
.
get
(
"
/signup
"
,
function
(
req
,
res
)
{
res
.
render
(
'
signup.ejs
'
,
{
title
:
'
Sign Up
'
,
fullpage
:
false
});
});
...
...
@@ -141,7 +139,7 @@ function router(app) {
REDIRECTS
=
{
"
/manage
"
:
"
/
"
,
"
/users
"
:
"
/
"
,
"
/users/
"
:
"
/
"
,
"
/users/
"
:
"
/
"
,
"
/primaries
"
:
"
/developers
"
,
"
/primaries/
"
:
"
/developers
"
,
"
/developers
"
:
"
https://github.com/mozilla/browserid/wiki/How-to-Use-BrowserID-on-Your-Site
"
...
...
@@ -160,6 +158,9 @@ function router(app) {
// register all the WSAPI handlers
wsapi
.
setup
(
app
);
// setup health check / heartbeat
heartbeat
.
setup
(
app
);
// the public key
app
.
get
(
"
/pk
"
,
function
(
req
,
res
)
{
res
.
json
(
ca
.
PUBLIC_KEY
.
toSimpleObject
());
...
...
This diff is collapsed.
Click to expand it.
browserid/static/ping.txt
deleted
100644 → 0
+
0
−
0
View file @
c03fa0ab
This diff is collapsed.
Click to expand it.
libs/heartbeat.js
0 → 100644
+
7
−
0
View file @
334721eb
exports
.
setup
=
function
(
app
)
{
app
.
get
(
"
/__heartbeat__
"
,
function
(
req
,
res
)
{
res
.
writeHead
(
200
);
res
.
write
(
'
ok
'
);
res
.
end
();
});
};
This diff is collapsed.
Click to expand it.
verifier/app.js
+
9
−
12
View file @
334721eb
...
...
@@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
const
path
=
require
(
'
path
'
),
url
=
require
(
'
url
'
),
fs
=
require
(
'
fs
'
),
const
path
=
require
(
'
path
'
),
url
=
require
(
'
url
'
),
fs
=
require
(
'
fs
'
),
certassertion
=
require
(
'
./lib/certassertion.js
'
),
express
=
require
(
'
express
'
),
metrics
=
require
(
'
../libs/metrics.js
'
),
logger
=
require
(
'
../libs/logging.js
'
).
logger
;
express
=
require
(
'
express
'
),
metrics
=
require
(
'
../libs/metrics.js
'
),
heartbeat
=
require
(
'
../libs/heartbeat.js
'
),
logger
=
require
(
'
../libs/logging.js
'
).
logger
;
logger
.
info
(
"
verifier server starting up
"
);
...
...
@@ -114,12 +115,8 @@ exports.setup = function(app) {
process
.
exit
();
});
// A simple ping hook for monitoring.
app
.
get
(
"
/ping.txt
"
,
function
(
req
,
resp
)
{
resp
.
writeHead
(
200
,
{
"
Content-Type
"
:
"
text/plain
"
})
resp
.
write
(
"
k.
"
);
resp
.
end
();
});
// setup health check / heartbeat
heartbeat
.
setup
(
app
);
app
.
post
(
'
/
'
,
doVerify
);
app
.
post
(
'
/verify
'
,
doVerify
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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