summary refs log tree commit diff
path: root/bundle
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-09 01:45:02 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-09 01:45:02 +0200
commit9fa4c607fc5056dc2b2cc0be9b425872ec91e292 (patch)
tree3ab5077ad34654b9ae5bdfc018ae0b4e7cc6f70e /bundle
parent:bug: fix build (diff)
downloadserver-9fa4c607fc5056dc2b2cc0be9b425872ec91e292.tar.xz
:art: fix imports with new build script
Diffstat (limited to 'bundle')
-rw-r--r--bundle/src/Server.ts10
-rw-r--r--bundle/src/start.ts5
2 files changed, 8 insertions, 7 deletions
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts
index 1596d54f..662b9008 100644
--- a/bundle/src/Server.ts
+++ b/bundle/src/Server.ts
@@ -2,11 +2,11 @@ process.on("unhandledRejection", console.error);
 process.on("uncaughtException", console.error);
 
 import http from "http";
-import { FosscordServer as APIServer } from "@fosscord/api";
-import { Server as GatewayServer } from "@fosscord/gateway";
+import * as Api from "@fosscord/api";
+import * as Gateway from "@fosscord/gateway";
 import { CDNServer } from "@fosscord/cdn/";
 import express from "express";
-import { red, green, bold } from "nanocolors";
+import { green, bold } from "nanocolors";
 import { Config, initDatabase } from "@fosscord/util";
 
 const app = express();
@@ -16,11 +16,11 @@ const production = false;
 server.on("request", app);
 
 // @ts-ignore
-const api = new APIServer({ server, port, production, app });
+const api = new Api.FosscordServer({ server, port, production, app });
 // @ts-ignore
 const cdn = new CDNServer({ server, port, production, app });
 // @ts-ignore
-const gateway = new GatewayServer({ server, port, production });
+const gateway = new Gateway.Server({ server, port, production });
 
 async function main() {
 	await initDatabase();
diff --git a/bundle/src/start.ts b/bundle/src/start.ts
index 872f324e..f65c1db9 100644
--- a/bundle/src/start.ts
+++ b/bundle/src/start.ts
@@ -1,7 +1,7 @@
 // process.env.MONGOMS_DEBUG = "true";
 const tsConfigPaths = require("tsconfig-paths");
 const path = require("path");
-const baseUrl = path.join(__dirname, ".."); // Either absolute or relative path. If relative it's resolved to current working directory.
+const baseUrl = path.join(__dirname, "..");
 const cleanup = tsConfigPaths.register({
 	baseUrl,
 	paths: {
@@ -13,6 +13,7 @@ const cleanup = tsConfigPaths.register({
 		"@fosscord/cdn/*": ["../cdn/dist/*"],
 	},
 });
+console.log(require("@fosscord/gateway"));
 
 import "reflect-metadata";
 import cluster from "cluster";
@@ -26,7 +27,7 @@ import { execSync } from "child_process";
 // TODO: add tcp socket event transmission
 const cores = 1 || Number(process.env.threads) || os.cpus().length;
 
-export function getCommitOrFail() {
+function getCommitOrFail() {
 	try {
 		return execSync("git rev-parse HEAD").toString().trim();
 	} catch (e) {