Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

hapi-oembed-provider

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-oembed-provider

Serve oEmbed resources from Hapi.js

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Hapi oEmbed Provider

An oembed provider handler for Hapi.js.

Build Status

Options

All oembed payload responses are valid option keys for the oEmbed handler.

The 'html' and 'title' keys may be callbacks to facilitate data real-time data-loading.

Setting Up Routes

In your oEmbed provider routes, you will want to add the following validation. (Assumes Joi library for route validation.)

    validate: {
        query: {
            url: Joi.required(),
            maxwidth: Joi.number().integer().min(1).default(600),
            maxheight: Joi.number().integer().min(1).default(600),
        }
    }

Example

    handler: {
        oembed: {
            type: 'rich',
            html: function(options, request) {
                return '<aside>This is the greatest</aside>'
            },
            title: function(options, request) {
                return 'Example',
            },
            provider_name: 'Example Content Provider',
            provider_url: 'http://example.com'
        }
    }

License

MIT © Adam Ross

Keywords

hapi

FAQs

Package last updated on 01 Feb 2015

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