Silence, dotenv, we dont want your ads
This commit is contained in:
parent
56db63df03
commit
0e495bc31d
@ -1,6 +1,6 @@
|
|||||||
/* eslint-env node */
|
/* eslint-env node */
|
||||||
|
|
||||||
require("dotenv").config();
|
require("dotenv").config({ quiet: true });
|
||||||
const { OPCODES } = require("../../dist/gateway/util/Constants.js");
|
const { OPCODES } = require("../../dist/gateway/util/Constants.js");
|
||||||
const WebSocket = require("ws");
|
const WebSocket = require("ws");
|
||||||
const ENDPOINT = `ws://localhost:3001?v=9&encoding=json`;
|
const ENDPOINT = `ws://localhost:3001?v=9&encoding=json`;
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
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 fetch = require("node-fetch");
|
||||||
const count = Number(process.env.COUNT) || 50;
|
const count = Number(process.env.COUNT) || 50;
|
||||||
const endpoint = process.env.API || "http://localhost:3001";
|
const endpoint = process.env.API || "http://localhost:3001";
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("module-alias/register");
|
require("module-alias/register");
|
||||||
require("dotenv").config();
|
require("dotenv").config({ quiet: true });
|
||||||
const { initDatabase } = require("..");
|
const { initDatabase } = require("..");
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
|||||||
@ -126,7 +126,8 @@ export class SpacebarServer extends Server {
|
|||||||
// 404 is not an error in express, so this should not be an error middleware
|
// 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
|
// 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.
|
// 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({
|
res.status(404).json({
|
||||||
message: "404 endpoint not found",
|
message: "404 endpoint not found",
|
||||||
code: 0,
|
code: 0,
|
||||||
|
|||||||
@ -23,7 +23,7 @@ process.on("unhandledRejection", console.error);
|
|||||||
|
|
||||||
import "missing-native-js-functions";
|
import "missing-native-js-functions";
|
||||||
import { config } from "dotenv";
|
import { config } from "dotenv";
|
||||||
config();
|
config({ quiet: true });
|
||||||
import { SpacebarServer } from "./Server";
|
import { SpacebarServer } from "./Server";
|
||||||
import cluster from "cluster";
|
import cluster from "cluster";
|
||||||
import os from "os";
|
import os from "os";
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import { red, bold, yellow, cyan, blueBright, redBright } from "picocolors";
|
|||||||
import { initStats } from "./stats";
|
import { initStats } from "./stats";
|
||||||
import { config } from "dotenv";
|
import { config } from "dotenv";
|
||||||
|
|
||||||
config();
|
config({ quiet: true });
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { centerString, Logo } from "@spacebar/util";
|
import { centerString, Logo } from "@spacebar/util";
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
import moduleAlias from "module-alias";
|
import moduleAlias from "module-alias";
|
||||||
moduleAlias(__dirname + "../../../package.json");
|
moduleAlias(__dirname + "../../../package.json");
|
||||||
import "dotenv/config";
|
import { config } from "dotenv";
|
||||||
|
config({ quiet: true});
|
||||||
|
|
||||||
import { CDNServer } from "./Server";
|
import { CDNServer } from "./Server";
|
||||||
const server = new CDNServer({ port: Number(process.env.PORT) || 3003 });
|
const server = new CDNServer({ port: Number(process.env.PORT) || 3003 });
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
import "missing-native-js-functions";
|
import "missing-native-js-functions";
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
dotenv.config();
|
dotenv.config({ quiet: true });
|
||||||
import {
|
import {
|
||||||
closeDatabase,
|
closeDatabase,
|
||||||
Config,
|
Config,
|
||||||
|
|||||||
@ -23,7 +23,7 @@ process.on("unhandledRejection", console.error);
|
|||||||
|
|
||||||
import { Server } from "./Server";
|
import { Server } from "./Server";
|
||||||
import { config } from "dotenv";
|
import { config } from "dotenv";
|
||||||
config();
|
config({ quiet: true });
|
||||||
|
|
||||||
let port = Number(process.env.PORT);
|
let port = Number(process.env.PORT);
|
||||||
if (isNaN(port)) port = 3002;
|
if (isNaN(port)) port = 3002;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ let dbConnection: DataSource | undefined;
|
|||||||
|
|
||||||
// For typeorm cli
|
// For typeorm cli
|
||||||
if (!process.env) {
|
if (!process.env) {
|
||||||
config();
|
config({ quiet: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
const dbConnectionString =
|
const dbConnectionString =
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
dotenv.config();
|
dotenv.config({ quiet: true });
|
||||||
import { closeDatabase, Config, initDatabase, initEvent } from "@spacebar/util";
|
import { closeDatabase, Config, initDatabase, initEvent } from "@spacebar/util";
|
||||||
import http from "http";
|
import http from "http";
|
||||||
import ws from "ws";
|
import ws from "ws";
|
||||||
|
|||||||
@ -22,7 +22,7 @@ process.on("unhandledRejection", console.error);
|
|||||||
|
|
||||||
import { config } from "dotenv";
|
import { config } from "dotenv";
|
||||||
import { Server } from "./Server";
|
import { Server } from "./Server";
|
||||||
config();
|
config({ quiet: true });
|
||||||
|
|
||||||
const port = Number(process.env.PORT) || 3004;
|
const port = Number(process.env.PORT) || 3004;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user