Skip to content

Commit 8febf9e

Browse files
feat: Enable Chiral interaction in Kitten Science
1 parent cb62d99 commit 8febf9e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/kitten-analysts/source/entrypoint-backend.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ import { kg_unicorns_sacrificed } from "./metrics/kg_unicorns_sacrificed.js";
5454
import { kg_years_total } from "./metrics/kg_years_total.js";
5555
import { KittensGameRemote } from "./network/KittensGameRemote.js";
5656

57+
export interface KGNetChiralCommand {
58+
command: string;
59+
}
60+
5761
const PORT_HTTP_KGNET = process.env.PORT_HTTP_KGNET ? Number(process.env.PORT_HTTP_KGNET) : 7780;
5862
const PORT_HTTP_METRICS = process.env.PORT_WS_BACKEND
5963
? Number(process.env.PORT_HTTP_METRICS)
@@ -286,6 +290,20 @@ routerNetwork.post("/kgnet/save/update", context => {
286290
}
287291
});
288292

293+
routerNetwork.post("/kgnet/chiral/game/command/", context => {
294+
try {
295+
//const payload = context.request.body as KGNetChiralCommand;
296+
context.status = 200;
297+
context.body = JSON.stringify({
298+
clientState: `Command received at ${new Date().toISOString()}.`,
299+
});
300+
return;
301+
} catch (error) {
302+
console.error(error);
303+
context.status = 500;
304+
}
305+
});
306+
289307
async function main() {
290308
try {
291309
const entries = await readdir(LOCAL_STORAGE_PATH);

0 commit comments

Comments
 (0)