Silence, dotenv, we dont want your ads

This commit is contained in:
Rory& 2025-09-29 22:11:08 +02:00
parent 56db63df03
commit 0e495bc31d
12 changed files with 14 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/* eslint-env node */
require("dotenv").config();
require("dotenv").config({ quiet: true });
const { OPCODES } = require("../../dist/gateway/util/Constants.js");
const WebSocket = require("ws");
const ENDPOINT = `ws://localhost:3001?v=9&encoding=json`;

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
require("dotenv").config();
require("dotenv").config({ quiet: true });
const fetch = require("node-fetch");
const count = Number(process.env.COUNT) || 50;
const endpoint = process.env.API || "http://localhost:3001";

View File

@ -26,7 +26,7 @@
*/
require("module-alias/register");
require("dotenv").config();
require("dotenv").config({ quiet: true });
const { initDatabase } = require("..");
(async () => {

View File

@ -126,7 +126,8 @@ export class SpacebarServer extends Server {
// 404 is not an error in express, so this should not be an error middleware
// this is a fine place to put the 404 handler because its after we register the routes
// and since its not an error middleware, our error handler below still works.
api.use("*", (req: Request, res: Response) => {
// Emma [it/its] @ Rory& - the _ is required now, as pillarjs throw an error if you don't pass a param name now
api.use("*_", (req: Request, res: Response) => {
res.status(404).json({
message: "404 endpoint not found",
code: 0,

View File

@ -23,7 +23,7 @@ process.on("unhandledRejection", console.error);
import "missing-native-js-functions";
import { config } from "dotenv";
config();
config({ quiet: true });
import { SpacebarServer } from "./Server";
import cluster from "cluster";
import os from "os";

View File

@ -27,7 +27,7 @@ import { red, bold, yellow, cyan, blueBright, redBright } from "picocolors";
import { initStats } from "./stats";
import { config } from "dotenv";
config();
config({ quiet: true });
import { execSync } from "child_process";
import { centerString, Logo } from "@spacebar/util";

View File

@ -18,7 +18,8 @@
import moduleAlias from "module-alias";
moduleAlias(__dirname + "../../../package.json");
import "dotenv/config";
import { config } from "dotenv";
config({ quiet: true});
import { CDNServer } from "./Server";
const server = new CDNServer({ port: Number(process.env.PORT) || 3003 });

View File

@ -18,7 +18,7 @@
import "missing-native-js-functions";
import dotenv from "dotenv";
dotenv.config();
dotenv.config({ quiet: true });
import {
closeDatabase,
Config,

View File

@ -23,7 +23,7 @@ process.on("unhandledRejection", console.error);
import { Server } from "./Server";
import { config } from "dotenv";
config();
config({ quiet: true });
let port = Number(process.env.PORT);
if (isNaN(port)) port = 3002;

View File

@ -30,7 +30,7 @@ let dbConnection: DataSource | undefined;
// For typeorm cli
if (!process.env) {
config();
config({ quiet: true });
}
const dbConnectionString =

View File

@ -16,7 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import dotenv from "dotenv";
dotenv.config();
dotenv.config({ quiet: true });
import { closeDatabase, Config, initDatabase, initEvent } from "@spacebar/util";
import http from "http";
import ws from "ws";

View File

@ -22,7 +22,7 @@ process.on("unhandledRejection", console.error);
import { config } from "dotenv";
import { Server } from "./Server";
config();
config({ quiet: true });
const port = Number(process.env.PORT) || 3004;