2023-05-19 15:22:48 -03:00
|
|
|
import { RequestHandler } from "express";
|
2023-06-03 19:24:57 -07:00
|
|
|
import { createNewSession } from "@/src/managers/sessionManager";
|
2023-05-23 20:53:26 -04:00
|
|
|
|
2023-05-19 15:22:48 -03:00
|
|
|
const hostSessionController: RequestHandler = (_req, res) => {
|
2023-06-01 17:08:05 -07:00
|
|
|
console.log("HostSession Request:", JSON.parse(_req.body));
|
2023-06-03 19:24:57 -07:00
|
|
|
let session = createNewSession(JSON.parse(_req.body), _req.query.accountId as string);
|
|
|
|
console.log("New Session Created: ", session);
|
2023-06-01 17:08:05 -07:00
|
|
|
|
2023-06-03 19:24:57 -07:00
|
|
|
res.json({ sessionId: { $oid: session.sessionId }, rewardSeed: 99999999 });
|
2023-05-19 15:22:48 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
export { hostSessionController };
|