Ringtone app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
876 B

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