Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@scaleleap/fastify

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scaleleap/fastify

Fastify helpers

  • 1.0.13
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

📦 @scaleleap/fastify

Fastify helpers.


Usage

import { createServer, createRoute, createSchema, typebox } from '../src'
import { createLogger } from '@scaleleap/logger'

const { server, listen } = createServer({
  logger: createLogger(),
})

server.route(
  createRoute(
    // same params as server.route(...)
    {
      method: 'GET',
      url: '/',
      handler: async (req, res) => ({ page: req.query.page }),
    },

    // creates a JSON Schema validator for the request, fully type inferred
    createSchema({
      querystring: typebox.Type.Object({
        page: typebox.Type.Number({ minimum: 1, maximum: 99 }),
      }),
    }),
  ),
)

// has sane defaults for port and address
listen()

You can also find the runnable example in test/server.ts

Download & Installation

$ npm i -s @scaleleap/fastify

Contributing

This repository uses Conventional Commit style commit messages.

Authors or Acknowledgments

  • Roman Filippov (Scale Leap)

License

This project is licensed under the MIT License.

Badges

GitHub Workflow Status NPM License Coveralls Semantic Release

FAQs

Package last updated on 05 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc