@@ -41,30 +41,30 @@ export default async function (instance: FastifyInstance): Promise<void> {
4141
4242 // register some dependencies manually
4343 registerDependencies ( instance . log ) ;
44-
45- await instance . register ( fp ( metaPlugin ) ) ;
44+ await instance . register ( metaPlugin ) ;
4645
4746 await instance . register ( fp ( passportPlugin ) ) ;
48- // need to be defined before member and item for auth check
49-
50- await instance . register ( maintenancePlugin ) ;
51-
52- await instance . register ( fp ( authPlugin ) ) ;
5347
54- await instance . register ( async ( instance ) => {
55- // core API modules
56- await instance
57- // the websockets plugin must be registered before but in the same scope as the apis
58- // otherwise tests somehow bypass mocking the authentication through jest.spyOn(app, 'verifyAuthentication')
59- . register ( fp ( websocketsPlugin ) , {
60- prefix : '/ws' ,
61- redis : {
62- channelName : 'graasp-realtime-updates' ,
63- connection : REDIS_CONNECTION ,
64- } ,
65- } )
66- . register ( fp ( MemberServiceApi ) )
67- . register ( fp ( ItemServiceApi ) )
68- . register ( tagPlugin ) ;
69- } ) ;
48+ await instance . register (
49+ async ( instance ) => {
50+ // need to be defined before member and item for auth check
51+ await instance . register ( fp ( authPlugin ) ) ;
52+ // core API modules
53+ await instance
54+ // the websockets plugin must be registered before but in the same scope as the apis
55+ // otherwise tests somehow bypass mocking the authentication through jest.spyOn(app, 'verifyAuthentication')
56+ . register ( fp ( websocketsPlugin ) , {
57+ prefix : '/ws' ,
58+ redis : {
59+ channelName : 'graasp-realtime-updates' ,
60+ connection : REDIS_CONNECTION ,
61+ } ,
62+ } )
63+ . register ( fp ( MemberServiceApi ) )
64+ . register ( fp ( ItemServiceApi ) )
65+ . register ( tagPlugin )
66+ . register ( maintenancePlugin ) ;
67+ } ,
68+ { prefix : '/api' } ,
69+ ) ;
7070}
0 commit comments