servie-mount
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Servie Mount

NPM version NPM downloads Build status Test coverage

Mount Servie middleware on a path prefix.

Installation

npm install servie-mount --save

Usage

import { mount, path, params, originalUrl } from "servie-mount";
import { compose } from "throwback";
import { Response } from "servie";

const fn = req => {
  console.log(req[path]); // Get mounted path.
  console.log(req[params]); // Get mounted params.
  console.log(req[originalUrl]); // Get original URL string.

  return new Response("hello world");
};

const app = compose([mount("/hello", fn)]);

TypeScript

This project is written using TypeScript and publishes the definitions directly to NPM.

License

Apache 2.0

/servie-mount/

    Package Sidebar

    Install

    npm i servie-mount

    Weekly Downloads

    0

    Version

    3.0.0

    License

    Apache-2.0

    Unpacked Size

    18.6 kB

    Total Files

    9

    Last publish

    Collaborators

    • blakeembrey