import * as fp from 'fastify-plugin';
import { fastifySequelize } from 'fastify-sequelize-plugin';
const fastifySequelizeOptions: FastifySequelizeOptions<HttpServer, RawRequest, RawResponse> = {
sequelize: {
dialect: 'postgres',
logging: false,
host: process.env.POSTGRES_HOST,
port: Number.parseInt(process.env.POSTGRES_PORT),
database: process.env.POSTGRES_DATABASE,
username: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
models: [],
},
};
const fastifySequelizePlugin = fp<
HttpServer,
HttpRequest,
HttpResponse,
FastifySequelizeOptions<HttpServer, HttpRequest, HttpResponse>
>(fastifySequelize);
this.fastify.register(fastifySequelizePlugin, fastifySequelizeOptions);
-
Notifications
You must be signed in to change notification settings - Fork 0
datawok/fastify-sequelize-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Fastify Sequelize Plugin
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published