75 lines
2.1 KiB
JavaScript
75 lines
2.1 KiB
JavaScript
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"
|
|
})
|
|
}
|
|
} |