MCPcopy Index your code
hub / github.com/PavloPoliakov/fastify-blipp

github.com/PavloPoliakov/fastify-blipp @4.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.0.0 ↗ · + Follow
3 symbols 11 edges 6 files 0 documented · 0% updated 3y ago4.0.0 · 2023-03-14★ 33
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

fastify-blipp prints your routes to the console. So each time your server starts, you know which endpoints are available.

(inspired by blipp hapijs plugin)

install

npm i fastify-blipp

usage

It is important to register the plugin as soon as possible, so it starts to listen for the new routes.

import { fastify as fastifyInstance} from "fastify";
import blippPlugin from "fastify-blipp";

const fastify = fastifyInstance();

// register it as early as possible
fastify.register(blippPlugin);
//or if you wan't custom log function
// fastify.register(require("fastify-blipp"), {blippLog: (msg) => console.log(msg)});

fastify.register(
    (fastify, {}, done) => {
        fastify.get("/hello/:username", async (req, reply) => ({
            greeting: `Hello, ${req.params.username}`
          }));
          fastify.get("/hello/:username/CAPS", async (req, reply) => ({
            greeting: `Hello, ${req.params.username.toUpperCase()}`
          }));
          fastify.post("/hello", async (req, reply) => ({
            greeting: `Hello, ${req.body.username}`
          }));
          fastify.get(
            "/example/at/:hour(^\\d{2})h:minute(^\\d{2})m",
            async (req, reply) => ({
              hour: req.params.hour,
              minute: req.params.minute
            })
          );
        done();
    }
)

const start = async () => {
  try {
    await fastify.listen({port:3000});

    fastify.blipp();

    console.log(`server listening on ${fastify.server.address().port}`);
  } catch (err) {
    console.error(err);
    process.exit(1);
  }
};

start();

result

image

Extension points exported contracts — how you extend this code

BlippOptions (Interface)
(no doc)
index.d.ts
FastifyInstance (Interface)
(no doc)
index.d.ts

Core symbols most depended-on inside this repo

start
called by 1
var/examples/six-kind-of-routes-server.js

Shape

Interface 2
Function 1

Languages

TypeScript100%

Modules by API surface

index.d.ts2 symbols
var/examples/six-kind-of-routes-server.js1 symbols

For agents

$ claude mcp add fastify-blipp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page