New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

routup

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

routup

Routup is a minimalistic http based routing framework.

Source
npmnpm
Version
0.14.2
Version published
Maintainers
1
Created
Source

routup 🧙‍

npm version main codecov Known Vulnerabilities Conventional Commits

Routup is a lightweight and extendable http interface based routing framework. It uses node's vanilla request and response interfaces, which are injected into route handlers aka middlewares as function argument.

Helpers provide additional functionalities to transform and interact with the request and manipulate the response upstream.

Table of Contents

Installation

npm install routup --save

Features

  • 🚀 high performance routing
  • 🧰 response & request helpers/utilities
  • 💼 extendable & compact
  • 🛫 named route parameters
  • 📁 nestable routers
  • 😌 define one or many (error-) middlewares
  • ✨ promise support for route- & middleware-handlers
  • 👕 TypeScript fully supported
  • 🤏 Minimalistic to fit into any solution with minimum overhead
  • & much more

Documentation

To read the docs, visit https://routup.net

Usage

import { Router, send } from 'routup';

const router = new Router();

router.get('/', (req, res) => {
    send(res, 'Hello World');
});

router.listen(3000);

Plugins

According to the fact that routup is a minimalistic framework, it depends on plugins to cover some typically http framework functions, which are not integrated in the main package.

NameDescription
bodyRead and parse the request body.
cookieRead and parse request cookies and serialize cookies for the response.
decoratorsCreate request handlers with class-, method- & parameter-decorators.
prometheusCollect and serve metrics for prometheus.
queryRead and parse the query string of the request url.
rate-limitRate limit incoming requests.
rate-limit-redisRedis adapter for the rate-limit plugin.
staticServe static files from a directory.
swaggerServe generated docs from URL or based on a JSON file.

License

Made with 💚

Published under MIT License.

Keywords

api

FAQs

Package last updated on 11 May 2023

Related posts