resource-url

0.1.1 • Public • Published

A wrapper around url to configure static resource access.

Useful in a react component so we can abstract away our static hosting

Usage

var resourceUrl = require('resource-url')

// Configure the default hostname and protocol
resourceUrl.host = 'static.musicmap.io';
resourceUrl.protocol = 'http';

// Usage in React component
<img src={resourceUrl('/client-website/active/images/eye.svg')}/>

Readme

Keywords

Package Sidebar

Install

npm i resource-url

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • scramblor