routes and stuff

This commit is contained in:
Flummi
2021-12-06 10:21:11 +01:00
parent 43665884f6
commit f7313d864c
9 changed files with 216 additions and 151 deletions

View File

@@ -57,6 +57,13 @@ export default new class {
createID() {
return crypto.randomBytes(16).toString("hex") + Date.now().toString(24);
};
genLink(env) {
const link = [];
if(env.user) link.push("user", env.user);
if(env.mime.length > 2) link.push(env.mime);
if(env.page) link.push("p", env.page);
return link.join("/");
};
// async funcs
async countf0cks() {