File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 23
23
24
24
async function applyServer ( ctx : Context ) {
25
25
ctx . plugin ( require ( './service/server' ) ) ;
26
- ctx . plugin ( ( require ( './service/db' ) ) . default ) ;
26
+ ctx . plugin ( require ( './service/db' ) ) ;
27
27
ctx . plugin ( require ( './service/fetcher' ) ) ;
28
28
ctx . inject ( [ 'server' , 'dbservice' , 'fetcher' ] , ( c ) => {
29
29
c . plugin ( require ( './handler/misc' ) ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ declare module 'cordis' {
21
21
}
22
22
}
23
23
24
- export default class DBService extends Service {
24
+ export class DBService extends Service {
25
25
constructor ( ctx : Context ) {
26
26
fs . ensureDirSync ( path . resolve ( process . cwd ( ) , 'data/.db' ) ) ;
27
27
super ( ctx , 'dbservice' , true ) ;
@@ -47,3 +47,8 @@ export default class DBService extends Service {
47
47
await this . initDatabase ( 'teams' , [ ] ) ;
48
48
}
49
49
}
50
+
51
+ export function apply ( ctx : Context ) {
52
+ ctx . provide ( 'dbservice' , undefined , true ) ;
53
+ ctx . dbservice = new DBService ( ctx ) ;
54
+ }
You can’t perform that action at this time.
0 commit comments