Ringtone app
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

43 řádky
1.0 KiB

  1. import '@abraham/reflection'
  2. import {join} from 'path'
  3. import AutoLoad, {AutoloadPluginOptions} from 'fastify-autoload'
  4. import {FastifyPluginAsync} from 'fastify'
  5. import {container} from 'tsyringe';
  6. export type AppOptions = {
  7. // Place your custom options for app below here.
  8. } & Partial<AutoloadPluginOptions>;
  9. const app: FastifyPluginAsync<AppOptions> = async (
  10. fastify,
  11. opts,
  12. ): Promise<void> => {
  13. // Place here your custom code!
  14. const modules = await Promise.all([
  15. import('./global'),
  16. import('./modules/ringtone'),
  17. ])
  18. modules.forEach(m => m.default(container))
  19. // Do not touch the following lines
  20. // This loads all plugins defined in plugins
  21. // those should be support plugins that are reused
  22. // through your application
  23. void fastify.register(AutoLoad, {
  24. dir: join(__dirname, 'plugins'),
  25. options: opts,
  26. });
  27. // This loads all plugins defined in routes
  28. // define your routes in one of these
  29. void fastify.register(AutoLoad, {
  30. dir: join(__dirname, 'routes'),
  31. options: opts,
  32. });
  33. };
  34. export default app;