diff options
Diffstat (limited to 'cdn')
-rw-r--r-- | cdn/package.json | 4 | ||||
-rw-r--r-- | cdn/src/Server.ts | 24 | ||||
-rw-r--r-- | cdn/src/routes/attachments.ts | 2 | ||||
-rw-r--r-- | cdn/src/routes/avatars.ts | 2 | ||||
-rw-r--r-- | cdn/src/routes/external.ts | 2 |
5 files changed, 17 insertions, 17 deletions
diff --git a/cdn/package.json b/cdn/package.json index 47dc6afa..21976809 100644 --- a/cdn/package.json +++ b/cdn/package.json @@ -5,6 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "link": "npm run build && npm link", + "postinstall": "npm run --prefix ../util/ link && npm link @fosscord/util && npm run link", "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc -b .", "start": "npm run build && node dist/start.js" @@ -21,7 +23,7 @@ }, "homepage": "https://github.com/discord-open-source/discord-cdn#readme", "dependencies": { - "@fosscord/server-util": "file:../util", + "@fosscord/util": "file:../util", "body-parser": "^1.19.0", "btoa": "^1.2.1", "cheerio": "^1.0.0-rc.5", diff --git a/cdn/src/Server.ts b/cdn/src/Server.ts index 1b79b037..a73a948c 100644 --- a/cdn/src/Server.ts +++ b/cdn/src/Server.ts @@ -1,5 +1,5 @@ import { Server, ServerOptions } from "lambert-server"; -import { Config, db } from "@fosscord/server-util"; +import { Config, db } from "@fosscord/util"; import path from "path"; import avatarsRoute from "./routes/avatars"; @@ -13,11 +13,9 @@ export class CDNServer extends Server { } async start() { - console.log("[Database] connecting ..."); // @ts-ignore await (db as Promise<Connection>); await Config.init(); - console.log("[Database] connected"); this.app.use((req, res, next) => { res.set("Access-Control-Allow-Origin", "*"); // TODO: use better CSP policy @@ -33,31 +31,31 @@ export class CDNServer extends Server { await this.registerRoutes(path.join(__dirname, "routes/")); this.app.use("/icons/", avatarsRoute); - this.log("info", "[Server] Route /icons registered"); + this.log("verbose", "[Server] Route /icons registered"); this.app.use("/emojis/", avatarsRoute); - this.log("info", "[Server] Route /emojis registered"); + this.log("verbose", "[Server] Route /emojis registered"); this.app.use("/stickers/", avatarsRoute); - this.log("info", "[Server] Route /stickers registered"); + this.log("verbose", "[Server] Route /stickers registered"); this.app.use("/banners/", avatarsRoute); - this.log("info", "[Server] Route /banners registered"); - + this.log("verbose", "[Server] Route /banners registered"); + this.app.use("/splashes/", avatarsRoute); - this.log("info", "[Server] Route /splashes registered"); + this.log("verbose", "[Server] Route /splashes registered"); this.app.use("/app-icons/", avatarsRoute); - this.log("info", "[Server] Route /app-icons registered"); + this.log("verbose", "[Server] Route /app-icons registered"); this.app.use("/app-assets/", avatarsRoute); - this.log("info", "[Server] Route /app-assets registered"); + this.log("verbose", "[Server] Route /app-assets registered"); this.app.use("/discover-splashes/", avatarsRoute); - this.log("info", "[Server] Route /discover-splashes registered"); + this.log("verbose", "[Server] Route /discover-splashes registered"); this.app.use("/team-icons/", avatarsRoute); - this.log("info", "[Server] Route /team-icons registered"); + this.log("verbose", "[Server] Route /team-icons registered"); return super.start(); } diff --git a/cdn/src/routes/attachments.ts b/cdn/src/routes/attachments.ts index c387aa37..6ce64ed4 100644 --- a/cdn/src/routes/attachments.ts +++ b/cdn/src/routes/attachments.ts @@ -1,5 +1,5 @@ import { Router, Response, Request } from "express"; -import { Config, Snowflake } from "@fosscord/server-util"; +import { Config, Snowflake } from "@fosscord/util"; import { storage } from "../util/Storage"; import FileType from "file-type"; import { HTTPError } from "lambert-server"; diff --git a/cdn/src/routes/avatars.ts b/cdn/src/routes/avatars.ts index 60befe2c..03388afc 100644 --- a/cdn/src/routes/avatars.ts +++ b/cdn/src/routes/avatars.ts @@ -1,5 +1,5 @@ import { Router, Response, Request } from "express"; -import { Config, Snowflake } from "@fosscord/server-util"; +import { Config, Snowflake } from "@fosscord/util"; import { storage } from "../util/Storage"; import FileType from "file-type"; import { HTTPError } from "lambert-server"; diff --git a/cdn/src/routes/external.ts b/cdn/src/routes/external.ts index 3abe9c22..625b6bbd 100644 --- a/cdn/src/routes/external.ts +++ b/cdn/src/routes/external.ts @@ -4,7 +4,7 @@ import { Router, Response, Request } from "express"; import fetch from "node-fetch"; import crypto from "crypto"; import { HTTPError } from "lambert-server"; -import { Snowflake } from "@fosscord/server-util"; +import { Snowflake } from "@fosscord/util"; import { storage } from "../util/Storage"; const router = Router(); |