Organized the differences between server and docker versions.
We are launching a docker version (server version) today so we want to just organize the repo so its easier to navigate.
This commit is contained in:
27
desktop/src/api/rpc/rpc.controller.ts
Normal file
27
desktop/src/api/rpc/rpc.controller.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { FastifyRequest, FastifyReply } from "fastify";
|
||||
import { setActivity, initRPC } from "./rp.service";
|
||||
|
||||
let initialized = false;
|
||||
|
||||
export function init() {
|
||||
if (!initialized) {
|
||||
initRPC(process.env.DISCORD_CLIENT_ID!);
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
export async function setRPC(request: FastifyRequest, reply: FastifyReply) {
|
||||
const { details, state, mode } = request.body as {
|
||||
details?: string;
|
||||
state?: string;
|
||||
mode?: "watching" | "reading" | string;
|
||||
};
|
||||
|
||||
setActivity({
|
||||
details,
|
||||
state,
|
||||
mode
|
||||
});
|
||||
|
||||
return reply.send({ ok: true });
|
||||
}
|
||||
Reference in New Issue
Block a user