Class: BaseAdminRoute
Defined in: service-core/src/routes/BaseAdminRoute.ts:65
The BaseAdminRoute class provides a base set of endpoints that gives trusted users the ability to perform common adminstrative actions
with the server.
Exposed endpoints:
| Name | HTTP Method | What it does |
|---|---|---|
clearCache | GET /<base_path>/clear-cache | Clears the Redis-based cache system. |
logs | UPGRADE /<base_path>/logs | Live tail the service logs |
getReleaseNotes | GET /<base_path>/release-notes | Retrieve the server release notes. |
restart | GET /<base_path>/restart | ` Restart the server |
!!Note!! that the BaseAdminRoute is not automatically registered with a server by default. You must create
your own class that extends AdminRoute and apply the desired base path with @Route().
Example
import \{ BaseAdminRoute, RouteDecorators \} from "@rapidrest/service-core";
const \{ Route \} = RouteDecorators;
@Route("/admin")
export class AdminRoute extends BaseAdminRoute \{\}
Constructors
Constructor
new BaseAdminRoute():
BaseAdminRoute
Returns
BaseAdminRoute
Properties
activeSockets
protectedactiveSockets:Map<string,any[]>
Defined in: service-core/src/routes/BaseAdminRoute.ts:67
A map of user uid's to active sockets.
cacheClient?
protectedoptionalcacheClient?:Redis
Defined in: service-core/src/routes/BaseAdminRoute.ts:70
cacheConnConfig
protectedcacheConnConfig:any
Defined in: service-core/src/routes/BaseAdminRoute.ts:73
logger
protectedlogger:any
Defined in: service-core/src/routes/BaseAdminRoute.ts:76
logsConnConfig
protectedlogsConnConfig:any
Defined in: service-core/src/routes/BaseAdminRoute.ts:79
redisClient?
protectedoptionalredisClient?:Redis
Defined in: service-core/src/routes/BaseAdminRoute.ts:81
releaseNotes?
protectedoptionalreleaseNotes?:string
Defined in: service-core/src/routes/BaseAdminRoute.ts:84
The underlying ReleaseNotes specification.
serviceName?
protectedoptionalserviceName?:string
Defined in: service-core/src/routes/BaseAdminRoute.ts:87
trustedRoles
protectedtrustedRoles:string[] =[]
Defined in: service-core/src/routes/BaseAdminRoute.ts:90
Methods
clearCache()
clearCache(
user?):Promise<void>
Defined in: service-core/src/routes/BaseAdminRoute.ts:134
Parameters
user?
JWTUser
Returns
Promise<void>
getReleaseNotes()
getReleaseNotes(
user?):string|undefined
Defined in: service-core/src/routes/BaseAdminRoute.ts:235
Parameters
user?
JWTUser
Returns
string | undefined
init()
protectedinit():Promise<void>
Defined in: service-core/src/routes/BaseAdminRoute.ts:93
Returns
Promise<void>
logs()
logs(
socket,user):Promise<void>
Defined in: service-core/src/routes/BaseAdminRoute.ts:165
Parameters
socket
user
JWTUser
Returns
Promise<void>
restart()
restart(
user?):void
Defined in: service-core/src/routes/BaseAdminRoute.ts:248
Parameters
user?
JWTUser
Returns
void