🎨 create start.ts
This commit is contained in:
parent
3b9e4a23c5
commit
e12197d568
@ -10,4 +10,4 @@ RUN apk del build-dependencies
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
EXPOSE 3002
|
||||
CMD ["node", "dist/"]
|
||||
CMD ["node", "dist/start.js"]
|
@ -2,12 +2,12 @@
|
||||
"name": "@fosscord/gateway",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "npm run build && node dist/",
|
||||
"start": "npm run build && node dist/start.js",
|
||||
"build": "npx tsc -b .",
|
||||
"dev": "tsnd --respawn src/index.ts"
|
||||
"dev": "tsnd --respawn src/start.ts"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Fosscord",
|
||||
|
10
src/index.ts
10
src/index.ts
@ -1,9 +1 @@
|
||||
process.on("uncaughtException", console.error);
|
||||
process.on("unhandledRejection", console.error);
|
||||
|
||||
import { Server } from "./Server";
|
||||
import { config } from "dotenv";
|
||||
config();
|
||||
|
||||
const server = new Server();
|
||||
server.listen();
|
||||
export * from "./Server";
|
||||
|
@ -62,7 +62,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
}) as MemberDocument[][];
|
||||
const user_guild_settings_entries = members.map((x) => x.settings);
|
||||
|
||||
const channels = await ChannelModel.find({ recipients: this.user_id }).exec();
|
||||
const channels = await ChannelModel.find({ recipient_ids: this.user_id }).exec();
|
||||
const user = await UserModel.findOne({ id: this.user_id }).exec();
|
||||
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
||||
|
||||
|
9
src/start.ts
Normal file
9
src/start.ts
Normal file
@ -0,0 +1,9 @@
|
||||
process.on("uncaughtException", console.error);
|
||||
process.on("unhandledRejection", console.error);
|
||||
|
||||
import { Server } from "./Server";
|
||||
import { config } from "dotenv";
|
||||
config();
|
||||
|
||||
const server = new Server();
|
||||
server.listen();
|
Loading…
x
Reference in New Issue
Block a user