mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Enable dependency injection with auto-generated components
This commit is contained in:
committed by
Joachim Van Herwegen
parent
e88e680ed7
commit
db04c55196
@@ -3,7 +3,7 @@ import { AclManager } from '../authorization/AclManager';
|
||||
import { ExpressHttpServer } from '../server/ExpressHttpServer';
|
||||
import { ResourceStore } from '../storage/ResourceStore';
|
||||
import { DATA_TYPE_BINARY } from '../util/ContentTypes';
|
||||
import { RuntimeConfig } from './RuntimeConfig';
|
||||
import { RuntimeConfig, RuntimeConfigData } from './RuntimeConfig';
|
||||
|
||||
/**
|
||||
* Invokes all logic to setup a server.
|
||||
@@ -28,10 +28,11 @@ export class Setup {
|
||||
|
||||
/**
|
||||
* Set up a server at the given port and base URL.
|
||||
* @param port - A port number.
|
||||
* @param base - A base URL.
|
||||
* @param data - Runtime config data.
|
||||
*/
|
||||
public async setup(): Promise<void> {
|
||||
public async setup(data: RuntimeConfigData = {}): Promise<RuntimeConfig> {
|
||||
this.runtimeConfig.reset(data);
|
||||
|
||||
// Set up acl so everything can still be done by default
|
||||
// Note that this will need to be adapted to go through all the correct channels later on
|
||||
const aclSetup = async(): Promise<void> => {
|
||||
@@ -61,9 +62,10 @@ export class Setup {
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
await aclSetup();
|
||||
|
||||
this.httpServer.listen(this.runtimeConfig.port);
|
||||
|
||||
return this.runtimeConfig;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user