Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

popsicle-prefix

2.0.1 • Public • Published

Popsicle Prefix

NPM version NPM downloads Build status Test coverage

Prefix all Popsicle HTTP requests.

Installation

npm install popsicle-prefix --save

Usage

import { middleware, toFetch } from "popsicle";
import { Request } from "popsicle/dist/node";
import { auth } from "popsicle-prefix";
 
const fetch = toFetch([prefix("http://example.com"), middleware], Request);
 
fetch("/users.json"); //=> Request("http://example.com/users.json")
fetch("http://foo.com/users.json"); //=> Request("http://example.com/http://foo.com/users.json")

License

MIT

Install

npm i popsicle-prefix

DownloadsWeekly Downloads

11

Version

2.0.1

License

MIT

Unpacked Size

9.28 kB

Total Files

9

Last publish

Collaborators

  • avatar