#fastify+nest+fastifyStatic types

1 messages · Page 1 of 1 (latest)

urban terrace
#

Hi, I'm creating app with
currently latest

 "@fastify/static": "^6.10.1",
 "@nestjs/platform-fastify": "^9.4.0",
 "fastify": "^4.17.0",

my code

 const app = await NestFactory.create<NestFastifyApplication>(
    AppModule,
    new FastifyAdapter({ logger: APP_USE_LOGGER }),
  );

  app.register(fastifyStatic, {
    root: path.resolve(process.cwd(), APP_STATIC_PATH),
    preCompressed: true,
  });

and I'm getting typeError on app.register(fastifyStatic
how to fix it)?

hasty valley
urban terrace
#

thank you, though I need to serve brotli/gzip preCompressed files, as I remember nestJs/serve-static wasn't supporting it few month ago(