Remove uoutdated routes
This commit is contained in:
parent
fe51bcfe1a
commit
e2e7c7cfc6
1 changed files with 0 additions and 93 deletions
|
|
@ -2456,99 +2456,6 @@ module.exports = async (
|
||||||
ap.get(`/api/gun/me`, apiGunMeGet)
|
ap.get(`/api/gun/me`, apiGunMeGet)
|
||||||
ap.put(`/api/gun/me`, apiGunMePut)
|
ap.put(`/api/gun/me`, apiGunMePut)
|
||||||
|
|
||||||
ap.get(`/api/gun/dev/currentHandshakeAddress`, async (_, res) => {
|
|
||||||
try {
|
|
||||||
const { tryAndWait } = require('../services/gunDB/contact-api/utils')
|
|
||||||
|
|
||||||
const data = await tryAndWait((_, u) =>
|
|
||||||
u.get(GunKey.CURRENT_HANDSHAKE_ADDRESS).then()
|
|
||||||
)
|
|
||||||
|
|
||||||
return res.status(200).json({
|
|
||||||
data
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
return res.status(500).json({
|
|
||||||
errorMessage: err.message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
ap.get(
|
|
||||||
`/api/gun/dev/handshakeNodes/:handshakeAddress`,
|
|
||||||
async (req, res) => {
|
|
||||||
try {
|
|
||||||
const { tryAndWait } = require('../services/gunDB/contact-api/utils')
|
|
||||||
|
|
||||||
const data = await tryAndWait(
|
|
||||||
g =>
|
|
||||||
new Promise(res => {
|
|
||||||
g.get(GunKey.HANDSHAKE_NODES)
|
|
||||||
.get(req.params.handshakeAddress)
|
|
||||||
.load(data => {
|
|
||||||
res(data)
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
v => {
|
|
||||||
if (typeof v !== 'object') {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v === null) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// load sometimes returns an empty set on the first try
|
|
||||||
return size(v) === 0
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return res.status(200).json({
|
|
||||||
data
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
return res.status(500).json({
|
|
||||||
errorMessage: err.message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
ap.get(`/api/gun/dev/user/:publicKey`, async (req, res) => {
|
|
||||||
try {
|
|
||||||
const { tryAndWait } = require('../services/gunDB/contact-api/utils')
|
|
||||||
|
|
||||||
const data = await tryAndWait(
|
|
||||||
g =>
|
|
||||||
new Promise(res => {
|
|
||||||
g.user(req.params.publicKey).load(data => {
|
|
||||||
res(data)
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
v => {
|
|
||||||
if (typeof v !== 'object') {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v === null) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// load sometimes returns an empty set on the first try
|
|
||||||
return size(v) === 0
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return res.status(200).json({
|
|
||||||
data
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
return res.status(500).json({
|
|
||||||
errorMessage: err.message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
ap.get(`/api/gun/auth`, (_, res) => {
|
ap.get(`/api/gun/auth`, (_, res) => {
|
||||||
const { isAuthenticated } = require('../services/gunDB/Mediator')
|
const { isAuthenticated } = require('../services/gunDB/Mediator')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue