6 changed files with 108 additions and 7 deletions
@ -1,3 +1,5 @@
|
||||
yarn-error.log |
||||
node_modules |
||||
production |
||||
production |
||||
**/*.key |
||||
**/*.pem |
@ -0,0 +1,75 @@
|
||||
import { config, getOverrideHandler, getOverridePreHandler } from "../config.js" |
||||
|
||||
export const meta = { |
||||
method: "GET", |
||||
url: "/", |
||||
schema: { |
||||
response: { |
||||
200: { |
||||
"type": "object", |
||||
"properties": { |
||||
"meta": { |
||||
"type": "object", |
||||
"properties": { |
||||
"serverName": { |
||||
"type": "string" |
||||
}, |
||||
"implementationName": { |
||||
"type": "string" |
||||
}, |
||||
"implementationVersion": { |
||||
"type": "string" |
||||
} |
||||
} |
||||
}, |
||||
"skinDomains": { |
||||
"type": "string" |
||||
}, |
||||
"signaturePublickey": { |
||||
"type": "string" |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
preHandler: getOverridePreHandler("/"), |
||||
handler: getOverrideHandler("/") ?? async function(req, rep) { |
||||
rep.code(200).send({ |
||||
meta: { |
||||
serverName: config.server.serverName, |
||||
implementationName: "lsp-yggdrasil", |
||||
implementationVersion: "1.0", |
||||
|
||||
}, |
||||
skinDomains: config.server.skinDomain, |
||||
signaturePublickey: this.keys.publicKey |
||||
}) |
||||
} |
||||
} |
||||
|
||||
export const status = { |
||||
method: "GET", |
||||
url: "/status", |
||||
schema: { |
||||
response: { |
||||
200: { |
||||
"type": "object", |
||||
"properties": { |
||||
"public": { |
||||
"type": "string" |
||||
}, |
||||
"version": { |
||||
"type": "string" |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
preHandler: getOverridePreHandler("/status"), |
||||
handler: getOverrideHandler("/status") ?? async function(req, rep) { |
||||
rep.code(200).send({ |
||||
public: this.keys.publicKey, |
||||
version: "1.0" |
||||
}) |
||||
} |
||||
} |
Loading…
Reference in new issue