Major refactoring: Add user id to API routes

This commit is contained in:
Benjamin Toby
2024-11-27 11:02:03 +01:00
parent a529d0bd08
commit b047d6557c
21 changed files with 144 additions and 49 deletions
+2
View File
@@ -8,6 +8,7 @@ const http = require("http");
* @property {string} host
* @property {number | string} port
* @property {typeof http | typeof https} scheme
* @property {string | number} user_id
*/
/**
@@ -29,6 +30,7 @@ function grabHostNames() {
host: remoteHost || localHost || "datasquirel.com",
port: remoteHostPort || localHostPort || 443,
scheme: scheme?.match(/^http$/i) ? http : https,
user_id: String(process.env.DSQL_API_USER_ID || 0),
};
}