femto-webapp/src/initApp.ts
2025-05-29 13:21:37 +02:00

22 lines
731 B
TypeScript

import { initUser } from './app/user/user.ts'
import { setGlobal } from './app/femtoApp.ts'
import { PostsService } from './app/feed/posts/postsService.ts'
import { MediaService } from './app/media/mediaService.ts'
import { AuthService } from './app/auth/authService.ts'
import { initClient } from './app/api/client.ts'
export function initApp() {
setGlobal('version', import.meta.env.VITE_FEMTO_VERSION)
initUser()
const client = initClient()
const postService = new PostsService(client)
const mediaService = new MediaService(client)
const authService = new AuthService(client)
setGlobal('postsService', postService)
setGlobal('authService', authService)
return { postService, mediaService, authService }
}