Skip to content

Commit

Permalink
Improves documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Vilmart committed Jul 1, 2014
1 parent 9489e22 commit 56758c0
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,60 @@ applinks-metatag
================

Express JS AppLinks injection middleware


##Installation

npm install --save applinks-metatag

##Usage

var express = require('express');
var AppLinks = require('applinks-metatag');
var app = Express();

app.use(AppLinks([{
platform: "ios",
url: "myApp://",
app_name: "My Awesome app"
}, {
platform: "android",
url: "myApp://",
package: "com.example.awesomeapp"
}]));


That will inject in all your pages :

<head>
...
<meta property="al:ios">
<meta property="al:ios:url" content="myApp://">
<meta property="al:ios:app_name" content="My Awesome app">
<meta property="al:android">
<meta property="al:android:url" content="myApp://">
<meta property="al:android:package" content="com.example.awesomeapp">
</head>


Or you can use at page scope:

app.get("/home", AppLinks([{
platform: "ios",
url: "myApp://",
app_name: "My Awesome app"
}], function(req, res){
res.render("home.ejs");
});

Or Based on request parameters:

app.get("/profile/:profile_id", AppLinks(function(req, res){
return {
platform: "ios",
url: "myApp://profile/"+req.params.profile_id,
app_name: "My Awesome app"
},
}),function(req, res){
res.render('profile.ejs');
})

0 comments on commit 56758c0

Please sign in to comment.