diff --git a/backend/src/index.ts b/backend/src/index.ts index 3b4bb3ed2732b95d9d4596474a08fc403e8a4a4d..78d55ec360188884e8f9274fa4a464f305873e33 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -14,6 +14,38 @@ server.get("/", function (request, reply) { reply.code(200).send("Hello, World!"); }); +server.route({ + method: "POST", + url: "/GetImage", + schema: { + body: { + type: "object", + properties: { + sessionImages: { + type: "array", + items: { type: "number" }, + }, + }, + }, + response: { + 200: { + type: "object", + properties: { + id: { type: "number" }, + image: { type: "string" }, + }, + }, + }, + }, + handler: function (request, reply) { + reply.send({ + id: 0, + image: + "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAA3SURBVBhXYyAXeHh43AeDhIQEqBAEAIX+g8H379+hQhAAlwACqBAEVFRUQESnT58OFSIRMDAAABZDJ2qjC6hLAAAAAElFTkSuQmCC", + }); + }, +}); + server.listen(process.env.PORT as string, "0.0.0.0", function (err, address) { if (err) { server.log.error(err);