add opengraph stuff

This commit is contained in:
biglyderv 2024-11-25 14:12:44 -05:00
parent 42aaebbd69
commit bde68d3797
14 changed files with 29 additions and 18 deletions

View file

@ -4,6 +4,9 @@ import initDb from "../db.js";
let db = await initDb();
let main = new Route([], async function (req, res, input) {
let {route} = req.params;
let {id} = req.query;
let body = { ...req.cookies, ...req.body };
let { token } = body;
@ -20,7 +23,11 @@ let main = new Route([], async function (req, res, input) {
return {
username,
valid: valid[0] ? valid[0].valid : 'noexist'
valid: valid[0] ? valid[0].valid : 'noexist',
url: `${process.env.URL}/client/${route}?id=${id || ''}`,
icon: `${process.env.URL}/static/img/logo.png`,
rootUrl: process.env.URL,
ogType: 'website'
};
});