Remove uoutdated routes

This commit is contained in:
Daniel Lugo 2021-07-22 17:10:08 -04:00
parent fe51bcfe1a
commit e2e7c7cfc6

View file

@ -2456,99 +2456,6 @@ module.exports = async (
ap.get(`/api/gun/me`, apiGunMeGet)
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) => {
const { isAuthenticated } = require('../services/gunDB/Mediator')