forked from godaddy/abstract-npm-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathping.js
More file actions
32 lines (29 loc) · 708 Bytes
/
ping.js
File metadata and controls
32 lines (29 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
const nit = require('./lib/nit')('GET /-/ping');
const requests = require('./lib/requests');
/**
* Test coverage for the simple ping route
* See: `curl http://{AUTH}@registry.npmjs.org/-/ping?write=true`
*/
module.exports.standard = nit(':api', function (opts) {
return function (done) {
requests.json({
host: opts.registry,
path: '/-/ping',
method: 'GET',
status: 200,
body: {}
}, done);
};
});
module.exports.write = nit(':api?write=true', function (opts) {
return function (done) {
requests.json({
host: opts.registry,
path: '/-/ping?write=true',
method: 'GET',
status: 200,
body: {}
}, done);
};
});