mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2025-01-09 14:29:27 -07:00
Add utils.generateProxyURL
This commit is contained in:
parent
9a1b5b889d
commit
596db98bfd
1 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
require('dotenv').config()
|
||||||
|
|
||||||
|
const DOIP_PROXY_HOSTNAME = process.env.DOIP_PROXY_HOSTNAME || 'proxy.keyoxide.org'
|
||||||
|
|
||||||
|
const generateProxyURL = (type, url) => {
|
||||||
|
return `https://${DOIP_PROXY_HOSTNAME}/api/1/get/${type}/${encodeURIComponent(url)}`
|
||||||
|
}
|
||||||
|
|
||||||
const generateClaim = (fingerprint, format) => {
|
const generateClaim = (fingerprint, format) => {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case 'uri':
|
case 'uri':
|
||||||
|
@ -14,4 +22,5 @@ const generateClaim = (fingerprint, format) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.generateProxyURL = generateProxyURL
|
||||||
exports.generateClaim = generateClaim
|
exports.generateClaim = generateClaim
|
||||||
|
|
Loading…
Reference in a new issue