This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To implement autosuggest, AMP examples use endpoints which are developed in node.js. | |
1. Declare necessary node.js modules: | |
var express = require('express'); | |
var app = express(); | |
2. Declare JSON object data as: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @license | |
* Copyright 2015 - present The AMP HTML Authors. All Rights Reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var express = require('express'); | |
var router = express.Router(); | |
var Slack = require('slack-node'); | |
var multer = require('multer'); | |
var multipart = multer(); | |
//sending messages to slack channel | |
router.post('/messages', multipart.fields([]), function(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oauth.js: | |
const GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; | |
module.exports = (passport) => { | |
passport.serializeUser((user, done) => { | |
done(null, user); | |
}); | |
passport.deserializeUser((user, done) => { | |
done(null, user); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PaywallAccess = require('../../models/amp-access'); | |
router.post('/amp-pingback', function(req, res) { | |
var readerId = req.query.rid; | |
if (!readerId) { | |
res.sendStatus(400); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{ | |
"@context":"http://schema.org/", | |
"@type":"AggregateRating", | |
"itemReviewed": "#productx", | |
"ratingValue":"4.9", | |
"bestRating":"5", | |
"reviewCount":"20", | |
"author": { | |
"@type":"Organization", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{"@context": "https://schema.org", "@type": "CreativeWork", "@id": "https://ontomatica.io/identifier/12000000001000011961", "name": "license", "description": "license document that applies to this content", "inLanguage": {"@id": "https://ontomatica.io/identifier/23010000007976101561"}, "citation": {"@type": "Claim", "@id": "https://ontomatica.io/identifier/12030100001000011961"}} | |
</script> | |
<script type="application/ld+json" id="1700000000100002.9161"> | |
{"@context":"http://schema.org/","@type":"Class","@id":"https://ontomatica.io/identifier/17000000001000029161","name":"Ashley Vandergrift","description":"Ashley is the lead data curator. She is responsible for the quality of content in Ontomatica repositories.","mainEntityOfPage":{"@id":"https://ontomatica.io/identifier/17000000001000021962"}}</script> | |
<script type="application/ld+json" id="1700000000100002.1962"> | |
{"@context":"http://schema.org/","@type":"TextDigitalDocument","@id":"https://ontomatica.io/identifier/170000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{"@context": "https://schema.org", "@type": "CreativeWork", "@id": "https://ontomatica.io/identifier/12000000001000011961", "name": "license", "description": "license document that applies to this content", "inLanguage": {"@id": "https://ontomatica.io/identifier/23010000007976101561"}, "citation": {"@type": "Claim", "@id": "https://ontomatica.io/identifier/12030100001000011961"}} | |
</script> | |
<script type="application/ld+json" id="1700000000100002.9161"> | |
{"@context":"http://schema.org/","@type":"Class","@id":"https://ontomatica.io/identifier/17000000001000029161","name":"Ashley Vandergrift","description":"Ashley is the lead data curator. She is responsible for the quality of content in Ontomatica repositories.","mainEntityOfPage":{"@id":"https://ontomatica.io/identifier/17000000001000021962"}}</script> | |
<script type="application/ld+json" id="1700000000100002.1962"> | |
{"@context":"http://schema.org/","@type":"TextDigitalDocument","@id":"https://ontomatica.io/identifier/170000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org/", | |
"@type": "Recipe", | |
"name": "Party Coffee Cake", | |
"image": "https://www.leannebrown.com/wp-content/uploads/2016/12/up-close-pear-cake.jpg", | |
"author": { | |
"@type": "Person", | |
"name": "Leanne Brown" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{"@context": "https://schema.org", "@type": "CreativeWork", "@id": "https://ontomatica.io/identifier/12000000001000011961", "name": "license", "description": "license document that applies to this content", "inLanguage": {"@id": "https://ontomatica.io/identifier/23010000007976101561"}, "citation": {"@type": "Claim", "@id": "https://ontomatica.io/identifier/12030100001000011961"}} | |
</script> | |
<script type="application/ld+json" id="1700000000100002.9161"> | |
{"@context":"http://schema.org/","@type":"Class","@id":"https://ontomatica.io/identifier/17000000001000029161","name":"Ashley Vandergrift","description":"Ashley is the lead data curator. She is responsible for the quality of content in Ontomatica repositories.","mainEntityOfPage":{"@id":"https://ontomatica.io/identifier/17000000001000021962"}}</script> | |
<script type="application/ld+json" id="1700000000100002.1962"> | |
{"@context":"http://schema.org/","@type":"TextDigitalDocument","@id":"https://ontomatica.io/identifier/170000000 |
OlderNewer