added search microservice

This commit is contained in:
SrGooglo 2025-01-25 19:49:06 +00:00
parent f35a3e7dbd
commit 033f22bc9d
3 changed files with 36 additions and 1 deletions

View File

@ -10,7 +10,7 @@
3007 -> ems (External Messaging Service) 3007 -> ems (External Messaging Service)
3008 -> users 3008 -> users
3009 -> notifications 3009 -> notifications
3010 -> unallocated 3010 -> search
3011 -> unallocated 3011 -> unallocated
3012 -> unallocated 3012 -> unallocated
3013 -> unallocated 3013 -> unallocated

View File

@ -0,0 +1,6 @@
{
"name": "search",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}

View File

@ -0,0 +1,29 @@
import { Server } from "linebridge"
import DbManager from "@shared-classes/DbManager"
import RedisClient from "@shared-classes/RedisClient"
import SharedMiddlewares from "@shared-middlewares"
class API extends Server {
static refName = "search"
static wsRoutesPath = `${__dirname}/ws_routes`
static routesPath = `${__dirname}/routes`
static listen_port = process.env.HTTP_LISTEN_PORT ?? 3010
middlewares = {
...SharedMiddlewares
}
contexts = {
db: new DbManager(),
redis: RedisClient(),
}
async onInitialize() {
await this.contexts.db.initialize()
await this.contexts.redis.initialize()
}
}
Boot(API)