werks here
This commit is contained in:
@@ -112,7 +112,7 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
|
||||
//translate RPCs to socket-bound function metadata
|
||||
const loadedPlugins = this.pm.getLoadedPlugins()
|
||||
for(const name in loadedPlugins){
|
||||
loadedPlugins[name].exportRPCs().forEach(rpc => {
|
||||
loadedPlugins[name].backend.exportRPCs().forEach(rpc => {
|
||||
const info = this.rpcToRpcInfo(name, rpc)
|
||||
rpcInfos.push(info)
|
||||
})
|
||||
@@ -170,6 +170,13 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
|
||||
this.express = express()
|
||||
this.express.use(express.static('static'))
|
||||
|
||||
this.express.get('/plugins/:id'+".js", (request, response) => {
|
||||
let frontend = this.pm.getFrontend(request.params.id)
|
||||
response.status(200)
|
||||
response.set('Content-Type', 'application/javascript')
|
||||
response.send(frontend)
|
||||
})
|
||||
|
||||
this.httpServer = new http.Server(this.express)
|
||||
this.httpServer.listen(port, () => {
|
||||
logger.info('Admin panel listening for HTTP on *'+port)
|
||||
@@ -257,6 +264,4 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
|
||||
}
|
||||
}
|
||||
|
||||
(async() => {
|
||||
new FrontblockAdmin()
|
||||
})()
|
||||
new FrontblockAdmin()
|
||||
|
||||
Reference in New Issue
Block a user