Skip to content

luuhai48/generator-fastify-ts

Repository files navigation

generator-fastify-ts NPM version

Fastify + Typescript boilerplate

Plugins included

How to use plugins

All plugins are registered in file src/app.ts. THE REGISTER ORDER are important, because one plugin can depends on another.

After registration, plugin can be accessed through app - which is instance of FastifyInstance.

Example:

// Example using it inside a route
app.get('/api', async (request, reply) => {
  const msgFromRedis = await app.redis.get('message');

  return reply.send({
    message: msgFromRedis,
  });
});

Installation

First, install Yeoman and generator-fastify-ts using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-fastify-ts

Then generate your new project:

yo fastify-ts

Changelog

  • Add plugin bcrypt
  • Update types for plugins
  • Update types for plugin s3
  • Replace @fastify/multipart with fastify-multer
  • Fix bug with s3 plugin
  • Fix bug with email plugin
  • Fix bug missing .gitignore file

License

MIT © luuhai48

About

Fastify + Typescript boilerplate with ready plugins

Resources

License

Stars

Watchers

Forks

Packages

No packages published