diff --git a/services/request/src/server/Application.ts b/services/request/src/server/Application.ts index bd2bab2..dd22290 100644 --- a/services/request/src/server/Application.ts +++ b/services/request/src/server/Application.ts @@ -1,5 +1,5 @@ import { Microservice } from "@autoplex/microservice"; -import services from "./services"; +import * as services from "./services"; import { User, RegisterToken } from "@autoplex/database"; /** @@ -15,7 +15,7 @@ export default class Application extends Microservice /** * Get the singleton application instance */ - public static instance() { return super.instance() } + public static instance() { return super.instance(); } /** * Create a new application instance diff --git a/services/request/src/server/services/Database.ts b/services/request/src/server/services/Database.ts deleted file mode 100644 index 2609198..0000000 --- a/services/request/src/server/services/Database.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Connection } from "typeorm"; -import { InternalService } from "@autoplex/microservice"; -import connectToDatabase from "@autoplex/database"; -import { env, secret } from "@autoplex/utils"; -import Application from "@server/Application"; - -export default class Database extends InternalService -{ - /** - * The active database connection - */ - protected connection!: Connection; - - /** - * The name of the service - */ - public readonly NAME = "Database"; - - /** - * Boot the database service - */ - public async boot() { - let host = env("DB_HOST"); - let port = parseInt(env("DB_PORT")); - let username = env("DB_USER"); - let password = await secret(env("DB_PASSWORD_FILE")); - let database = env("DB_DATABASE"); - this.connection = await connectToDatabase(host, port, username, password, database); - } - - /** - * Shutdown the database service - */ - public async shutdown() { - await this.connection.close(); - } -} diff --git a/services/request/src/server/services/index.ts b/services/request/src/server/services/index.ts index f5c6803..c3f5e95 100644 --- a/services/request/src/server/services/index.ts +++ b/services/request/src/server/services/index.ts @@ -1,13 +1,12 @@ -import Database from "./Database"; -import DiscordBot from "./DiscordBot"; -import MovieSearch from "./MovieSearch"; -import PlexLibrary from "./PlexLibrary"; -import SeekerIpcClient from "./Ipc/SeekerIpcClient"; -import TvDb from "./TvDb"; -import WebServer from "./WebServer/WebServer"; +export { DatabaseService } from "@autoplex/database"; +import DiscordBot from "./DiscordBot"; +import MovieSearch from "./MovieSearch"; +import PlexLibrary from "./PlexLibrary"; +import SeekerIpcClient from "./Ipc/SeekerIpcClient"; +import TvDb from "./TvDb"; +import WebServer from "./WebServer/WebServer"; -export default { - Database, +export { // DiscordBot, MovieSearch, PlexLibrary,