File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import http from 'http';
5
5
6
6
export interface CreateOptions extends CoreCreateOptions {
7
7
webSockets ?: boolean ;
8
+ initApp ?( app : express . Application ) : void | Promise < void > ;
8
9
}
9
10
10
11
declare class CubejsServer {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class CubejsServer {
12
12
this . webSockets = config . webSockets ;
13
13
this . redirector = null ;
14
14
this . server = null ;
15
+ this . initApp = config . initApp ;
15
16
}
16
17
17
18
async listen ( options = { } ) {
@@ -29,6 +30,10 @@ class CubejsServer {
29
30
app . use ( require ( "cors" ) ( ) ) ;
30
31
app . use ( bodyParser . json ( { limit : "50mb" } ) ) ;
31
32
33
+ if ( this . initApp ) {
34
+ await this . initApp ( app ) ;
35
+ }
36
+
32
37
await this . core . initApp ( app ) ;
33
38
34
39
return new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments