List, export, recommendations done
This commit is contained in:
21
routes/export.ts
Normal file
21
routes/export.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as express from "express";
|
||||
import * as QRCode from "qrcode";
|
||||
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.use((req, res, next) => {
|
||||
if (!req.cookies || !req.cookies.uid) {
|
||||
res.status(404);
|
||||
res.send();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
router.get("/", (req, res, next) => {
|
||||
QRCode.toDataURL(req.cookies.uid, (err, url) => {
|
||||
res.render("export", {title: "Export", uid: req.cookies.uid, dataurl: url});
|
||||
});
|
||||
});
|
||||
export = router;
|
||||
Reference in New Issue
Block a user