🐛 fix server bundle
This commit is contained in:
parent
aa5ed0a5ba
commit
d0bb45e0c4
1101
api/assets/0.d1d660cbcbc30384891c.css
Normal file
1101
api/assets/0.d1d660cbcbc30384891c.css
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/042023d8ee73c0c3fd74.js
Normal file
2
api/assets/042023d8ee73c0c3fd74.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/2cbabd9369e777f06572.js
Normal file
2
api/assets/2cbabd9369e777f06572.js
Normal file
@ -0,0 +1,2 @@
|
||||
(this.webpackJsonp=this.webpackJsonp||[]).push([[82],{7924:function(n,e,o){n.exports=function(){return new Worker(o.p+"9316137ca25a60d7180c.worker.js")}}}]);
|
||||
//# sourceMappingURL=2cbabd9369e777f06572.js.map
|
||||
3
api/assets/2def6ed70cf3dfe8990b.js
Normal file
3
api/assets/2def6ed70cf3dfe8990b.js
Normal file
File diff suppressed because one or more lines are too long
3
api/assets/36bf82052a3121a02046.js
Normal file
3
api/assets/36bf82052a3121a02046.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/49078e599d3842cb6dc8.js
Normal file
2
api/assets/49078e599d3842cb6dc8.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/4916ca4106799de584bb.js
Normal file
2
api/assets/4916ca4106799de584bb.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/4a5d0d639aefbb9cafca.js
Normal file
2
api/assets/4a5d0d639aefbb9cafca.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/51db8e3c2fa79df2bd16.js
Normal file
2
api/assets/51db8e3c2fa79df2bd16.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/5eae74fd6acd2647e0b7.js
Normal file
2
api/assets/5eae74fd6acd2647e0b7.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/7fbe1e6b1c5663e3a84e.js
Normal file
2
api/assets/7fbe1e6b1c5663e3a84e.js
Normal file
File diff suppressed because one or more lines are too long
3
api/assets/8c928ce26a3b4d828392.js
Normal file
3
api/assets/8c928ce26a3b4d828392.js
Normal file
File diff suppressed because one or more lines are too long
3
api/assets/8da53effd7b0af7e3415.js
Normal file
3
api/assets/8da53effd7b0af7e3415.js
Normal file
File diff suppressed because one or more lines are too long
3
api/assets/95efcedbf0bf27cbdbbd.js
Normal file
3
api/assets/95efcedbf0bf27cbdbbd.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/b94388e26490ecd7f18d.js
Normal file
2
api/assets/b94388e26490ecd7f18d.js
Normal file
File diff suppressed because one or more lines are too long
3
api/assets/ba19b6d2d1f3edd4a7eb.js
Normal file
3
api/assets/ba19b6d2d1f3edd4a7eb.js
Normal file
File diff suppressed because one or more lines are too long
3
api/assets/e852c523afaf4768e6bd.js
Normal file
3
api/assets/e852c523afaf4768e6bd.js
Normal file
File diff suppressed because one or more lines are too long
2
api/assets/f46fc057b352f07253c7.js
Normal file
2
api/assets/f46fc057b352f07253c7.js
Normal file
File diff suppressed because one or more lines are too long
BIN
api/package-lock.json
generated
BIN
api/package-lock.json
generated
Binary file not shown.
@ -31,26 +31,26 @@
|
||||
},
|
||||
"homepage": "https://fosscord.com",
|
||||
"devDependencies": {
|
||||
"0x": "^4.10.2",
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/bcrypt": "^5.0.0",
|
||||
"@types/express": "^4.17.9",
|
||||
"@types/i18next-node-fs-backend": "^2.1.0",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/mongodb": "^3.6.9",
|
||||
"@types/mongoose-autopopulate": "^0.10.1",
|
||||
"@types/mongoose-lean-virtuals": "^0.5.1",
|
||||
"@types/multer": "^1.4.5",
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||
"@types/mongodb": "^3.6.9",
|
||||
"@types/mongoose-autopopulate": "^0.10.1",
|
||||
"@types/mongoose-lean-virtuals": "^0.5.1",
|
||||
"0x": "^4.10.2",
|
||||
"caxa": "^2.1.0",
|
||||
"image-size": "^1.0.0",
|
||||
"jest": "^26.6.3",
|
||||
"saslprep": "^1.0.3",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.1.2",
|
||||
"ts-node-dev": "^1.1.6",
|
||||
"image-size": "^1.0.0"
|
||||
"typescript": "^4.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fosscord/util": "file:../util",
|
||||
|
||||
@ -69,11 +69,12 @@ export class FosscordServer extends Server {
|
||||
|
||||
this.routes = await this.registerRoutes(path.join(__dirname, "routes", "/"));
|
||||
|
||||
api.use("*", (req: Request, res: Response) => {
|
||||
api.use("*", (req: Request, res: Response, next) => {
|
||||
res.status(404).json({
|
||||
message: "404: Not Found",
|
||||
code: 0
|
||||
});
|
||||
next();
|
||||
});
|
||||
|
||||
this.app = app;
|
||||
|
||||
BIN
bundle/package-lock.json
generated
BIN
bundle/package-lock.json
generated
Binary file not shown.
@ -10,6 +10,7 @@
|
||||
"build:cdn": "cd ../cdn/ && npm run build",
|
||||
"build:gateway": "cd ../gateway/ && npm run build",
|
||||
"start": "npm run build && node dist/start.js",
|
||||
"bundle": "npm run build && node dist/startBundle.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
@ -29,15 +30,15 @@
|
||||
"@types/express": "^4.17.9",
|
||||
"@types/i18next-node-fs-backend": "^2.1.0",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/multer": "^1.4.5",
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||
"@types/mongodb": "^3.6.9",
|
||||
"@types/mongoose-autopopulate": "^0.10.1",
|
||||
"@types/mongoose-lean-virtuals": "^0.5.1",
|
||||
"@types/multer": "^1.4.5",
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@types/ws": "^7.4.0",
|
||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -48,6 +49,6 @@
|
||||
"async-exit-hook": "^2.0.1",
|
||||
"express": "^4.17.1",
|
||||
"mongodb-memory-server": "^7.3.6",
|
||||
"node-os-utils": "^1.3.5",
|
||||
"node-os-utils": "^1.3.5"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
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 { CDNServer } from "@fosscord/cdn/";
|
||||
import express from "express";
|
||||
import { Config } from "../../util/dist";
|
||||
|
||||
const app = express();
|
||||
const server = http.createServer();
|
||||
const port = Number(process.env.PORT) || 8080;
|
||||
const production = true;
|
||||
server.on("request", app);
|
||||
|
||||
// @ts-ignore
|
||||
const api = new APIServer({ server, port, production, app });
|
||||
// @ts-ignore
|
||||
const cdn = new CDNServer({ server, port, production, app });
|
||||
// @ts-ignore
|
||||
const gateway = new GatewayServer({ server, port, production });
|
||||
|
||||
async function main() {
|
||||
await Config.set({
|
||||
cdn: {
|
||||
endpointClient: "${location.host}",
|
||||
endpoint: `http://localhost:${port}`,
|
||||
},
|
||||
gateway: {
|
||||
endpointClient: '${location.protocol === "https:" ? "wss://" : "ws://"}${location.host}',
|
||||
endpoint: `ws://localhost:${port}`,
|
||||
},
|
||||
});
|
||||
|
||||
await api.start();
|
||||
await cdn.start();
|
||||
await gateway.start();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@ -2,7 +2,7 @@ import fs from "fs";
|
||||
import { MongoMemoryServer } from "mongodb-memory-server";
|
||||
import path from "path";
|
||||
import exitHook from "async-exit-hook";
|
||||
console.log(process.arch, process.platform);
|
||||
|
||||
if (process.arch == "ia32") {
|
||||
Object.defineProperty(process, "arch", {
|
||||
value: "x64",
|
||||
|
||||
@ -1,27 +1,35 @@
|
||||
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 { CDNServer } from "@fosscord/cdn/";
|
||||
import express from "express";
|
||||
import { Config } from "../../util/dist";
|
||||
|
||||
const production = true;
|
||||
const app = express();
|
||||
const server = http.createServer();
|
||||
const port = Number(process.env.PORT) || 8080;
|
||||
const production = false;
|
||||
server.on("request", app);
|
||||
|
||||
const api = new APIServer({ production, port: Number(process.env.API_PORT) || 3001 });
|
||||
const gateway = new GatewayServer({ port: Number(process.env.GATEWAY_PORT) || 3002 });
|
||||
const cdn = new CDNServer({ production, port: Number(process.env.CDN_PORT) || 3003 });
|
||||
// @ts-ignore
|
||||
const api = new APIServer({ server, port, production, app });
|
||||
// @ts-ignore
|
||||
const cdn = new CDNServer({ server, port, production, app });
|
||||
// @ts-ignore
|
||||
const gateway = new GatewayServer({ server, port, production });
|
||||
|
||||
async function main() {
|
||||
await Config.set({
|
||||
cdn: {
|
||||
endpointClient: "${location.host}",
|
||||
endpoint: `http://localhost:${cdn.options.port}`,
|
||||
endpoint: `http://localhost:${port}`,
|
||||
},
|
||||
gateway: {
|
||||
endpointClient:
|
||||
'${location.protocol === "https:" ? "wss://" : "ws://"}${location.hostname}:' + gateway.port,
|
||||
endpoint: `ws://localhost:${gateway.port}`,
|
||||
endpointClient: '${location.protocol === "https:" ? "wss://" : "ws://"}${location.host}',
|
||||
endpoint: `ws://localhost:${port}`,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -18,5 +18,5 @@ export function initStats() {
|
||||
process.memoryUsage().rss / 1024 / 1024
|
||||
)}mb/${memory.totalMemMb.toFixed(0)}mb`
|
||||
);
|
||||
}, 1000 * 60);
|
||||
}, 1000 * 30);
|
||||
}
|
||||
|
||||
BIN
cdn/package-lock.json
generated
BIN
cdn/package-lock.json
generated
Binary file not shown.
@ -21,20 +21,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/discord-open-source/discord-cdn#readme",
|
||||
"devDependencies": {
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/body-parser": "^1.19.0",
|
||||
"@types/btoa": "^1.2.3",
|
||||
"@types/dotenv": "^8.2.0",
|
||||
"@types/express": "^4.17.12",
|
||||
"@types/fs-extra": "^9.0.12",
|
||||
"@types/multer": "^1.4.7",
|
||||
"@types/node": "^14.17.0",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/mongodb": "^3.6.9",
|
||||
"@types/mongoose-autopopulate": "^0.10.1",
|
||||
"@types/mongoose-lean-virtuals": "^0.5.1"
|
||||
"@types/mongoose-lean-virtuals": "^0.5.1",
|
||||
"@types/multer": "^1.4.7",
|
||||
"@types/node": "^14.17.0",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/uuid": "^8.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fosscord/util": "file:../util",
|
||||
|
||||
BIN
gateway/package-lock.json
generated
BIN
gateway/package-lock.json
generated
Binary file not shown.
@ -15,13 +15,13 @@
|
||||
"devDependencies": {
|
||||
"@types/amqplib": "^0.8.1",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/mongoose-autopopulate": "^0.10.1",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@types/ws": "^7.4.0",
|
||||
"@types/mongodb": "^3.6.9",
|
||||
"@types/mongoose-autopopulate": "^0.10.1",
|
||||
"@types/mongoose-lean-virtuals": "^0.5.1",
|
||||
"@types/node": "^14.17.9",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@types/ws": "^7.4.0",
|
||||
"ts-node-dev": "^1.1.6",
|
||||
"typescript": "^4.2.3"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user