Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 885 Bytes

File metadata and controls

40 lines (29 loc) · 885 Bytes

altair-fastify-plugin

npm

This is a Fastify Plugin for hosting an instance of Altair GraphQL Client, with support for TypeScript, and tested for Fastify v3.

Install

npm install altair-fastify-plugin
# or
yarn add altair-fastify-plugin

Usage

// const Fastify = require("fastify");
import Fastify from 'fastify';
// const AltairFastify = require("altair-fastify-plugin");
import AltairFastify from 'altair-fastify-plugin';

const app = Fastify();

// ...

app.register(AltairFastify, {
  /**
   * All these are the defaults.
   */
  path: '/altair',
  baseURL: '/altair/',
  endpointURL: '/graphql',
});

// ...

// Altair available at localhost:3000/altair
app.listen(3000);