Skip to content
CoffeeScript HTML CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public/img
src
styles
views
.gitignore
LICENSE
README.md
package.json
server.coffee

README.md

Embed.rocks integration example (with a templating engine)

An example Node.js app for Embed.rocks. Use this for starting your own implementation.

Install by:

  • cloning this repository.
  • Configure API key (see below)
  • npm install
  • npm start
  • Then point your browser to http://127.0.0.1:3000

What this contains

This version of our integration example is made with a (Mustache-like) templating engine. The other version is with plain JavaScript and can be found here. You can use whichever suits you better, or even both.

In views/card.html file you will find the template that renders card data into html. You can use that as a basis for your own implementation.

In styles/card.style you will find the Stylus stylesheet code for cards.

In src/app/components/card.coffee you will find the CoffeeScript source code for handling the different Card functionalities.

Configuring

Set your API key in src/server/route.coffee.

Note that in this example app fetches the embed data on the server site, never exposing the api key to the public. This is how it should be done - securely on the server side, not directly on the client side.

Safe images

If you want to use a "safe domain" (for safe images), set it in src/app/components/card.coffee. Remember to add a trailing slash into it. For example //safe.mydomain.com/ (for both http and https). You need to have an NGINX setup for this. See the example nginx.conf.

About us

Brought to you by Embed.rocks, the Embed.ly alternative.

You can’t perform that action at this time.