diff options
Diffstat (limited to 'backend/ts/api/startPoint.ts')
| -rw-r--r-- | backend/ts/api/startPoint.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/backend/ts/api/startPoint.ts b/backend/ts/api/startPoint.ts new file mode 100644 index 0000000..0fa79e5 --- /dev/null +++ b/backend/ts/api/startPoint.ts @@ -0,0 +1,20 @@ +import { Request, Response } from "express"; +import { makeQuery } from "../../../helpers/helpers"; + +export default async function (req: Request, res: Response) { + if (req.session === undefined) { + res.send(/* html */ `<script>alert("Something went wrong, try to reload the page")</script>`); + return; + } + console.log("uid:", req.session.uid, "gid:", req.session.gid); + if (req.session.uid !== undefined) { + let data = await makeQuery('SELECT `data` FROM `fia` WHERE `id`=?', [req.session.gid]); + console.log("data: ", data); + res.send(JSON.stringify({ + status: true, + data: data + })) + } + else + res.send(JSON.stringify({ status: false })); +}
\ No newline at end of file |
