@tsed-plus/meilisearch
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Ts.ED Plus Meilisearch

Support for Meilisearch in your Ts.ED application.

Contents

Prerequisite

If you have not already, familiarize yourself with the Ts.ED framework and Meilisearch.

Getting Started

Install Dependencies

# npm
npm install meilisearch

# yarn
yarn add meilisearch

Install Ts.ED Module

# npm
npm install @tsed-plus/meilisearch

# yarn
yarn add @tsed-plus/meilisearch

Configuration

Enable MeiliSearch through configuration and pass any additional option that the MeiliSearch constructor accepts

@Configuration({
  // ...
  meilisearch: {
    enabled: true,
    // plus any option that the MeiliSearch constructor accepts, e.g.
    host: "127.0.0.1:7700",
  },
})
export class Server {

Inject the Meilisearch Client

Inject the MeiliSearchService in a service/controller of your choice.

import { Controller } from '@tsed/di';
import { Get } from '@tsed/schema';
import { MeiliSearchService } from '@tsed-plus/meilisearch';

@Controller('/')
export class HelloWorldController {
  @Inject()
  protected meilisearch: MeiliSearchService;

  @Get('/')
  async get() {
    return this.meilisearch.getIndexes();
  }
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2

Package Sidebar

Install

npm i @tsed-plus/meilisearch

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

6.38 kB

Total Files

11

Last publish

Collaborators

  • ochrstn