Code Monkey home page Code Monkey logo

aws-samples / content-aggregator-example Goto Github PK

View Code? Open in Web Editor NEW
37.0 9.0 27.0 580 KB

This repository contains all the example code to help you build a content aggregator like serverless land. It is split into 2 components: Part 1: The front-end, an auto-building static website. Part 2: The backend, am automaed content aggregation workflow.

License: MIT No Attribution

JavaScript 73.34% Vue 26.66%
serverless amplify lambda step-functions

content-aggregator-example's Introduction

Building Serverless Land

Serverlessland brings together all the latest blogs, videos, and training for AWS Serverless. Serverlessland

This repository contains all the example code to help you build a content aggregator like Serverlessland. It is split into 2 components: Part 1: The frontend, an auto-building static website. Part 2: The backend, an automated content aggregation workflow.

Part 1: Automated content aggregation (the backend application):

backend

Part 2: An auto-building static site (the front-end site)

This is a static website that automatically aggregates content from a number of RSS feeds. The content exists in static JSON files, which generate a new site build each time they are updated. The result is a low-maintenance, low-latency serverless website, with almost limitless scalability.

frontend

content-aggregator-example's People

Contributors

amazon-auto avatar bls20aws avatar teknogeek0 avatar weisisheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

content-aggregator-example's Issues

WriteToGithub lambda throws new / different error than #2

Oddly, this issue has popped up for me and googling doesn't surface any solutions.

{
"errorType": "SyntaxError",
"errorMessage": "Unexpected end of JSON input",
"trace": [
"SyntaxError: Unexpected end of JSON input",
" at JSON.parse ()",
" at Runtime.exports.handler (/var/task/WriteToGitHub.js:14:22)",
" at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:74:25)"
]
}


Using this as a reference-->

#2

Have tried to use with/without backslashes on both the github repo reference and the content.json reference in the SAM template.

github-repo/foo

github-repo/foo/

and

/frontend/content.json

frontend/content.json

Moreover, there is a space in the WriteToGitHub.js github key reference that I removed for my own repo. But no difference in error.

const singleParam = { Name: '/GitHubAPIKey ',WithDecryption: true }; --> const singleParam = { Name: '/GitHubAPIKey',WithDecryption: true };

The collection process works and there are numerous entries in the input before this lambda triggers.

Appreciate any trailheads.

TIA.

WriteToGithub lambda throws error

Error

2021-05-19T08:42:17.954Z 224af88d-9a12-4579-839a-1e85e79cd7ac ERROR RequestError [HttpError]: Not Found
at /var/task/node_modules/@octokit/request/dist-node/index.js:68:23
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Runtime.exports.handler (/var/task/WriteToGitHub.js:29:22) {
status: 404,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
connection: 'close',
'content-encoding': 'gzip',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Wed, 19 May 2021 08:42:17 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
'transfer-encoding': 'chunked',
vary: 'Accept-Encoding, Accept, X-Requested-With',
'x-accepted-oauth-scopes': 'repo',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': 'D7F8:1E3B:17DBF53:344F8DF:60A4CF69',
'x-oauth-scopes': 'admin:repo_hook, repo',
'x-ratelimit-limit': '5000',
'x-ratelimit-remaining': '4980',
'x-ratelimit-reset': '1621415637',
'x-ratelimit-resource': 'core',
'x-ratelimit-used': '20',
'x-xss-protection': '0'
},
request: {
method: 'PUT',
url: 'https://api.github.com/repos/shankey28/content-aggregator-example%5C/contents/%2Ffrontend%2Fcontent.json',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.5.3 octokit-core.js/3.4.0 Node.js/12.22.1 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{REDACTED}',
request: { hook: [Function: bound bound register] }
},
documentation_url: 'https://docs.github.com/rest/reference/repos#create-or-update-file-contents'
}

Tried below options for environment variables:

Does not work:

GitHubRepo

  1. https://github.com/shankey28/content-aggregator-example
    OR
  2. https://github.com/shankey28/content-aggregator-example\

JSONFILE (default in template.yml)
/frontend/content.json

Does work

GitHubRepo
https://github.com/shankey28/content-aggregator-example

JSONFile
frontend/content.json

Solution

Change the default value of JSONFile parameter in template.yml to 'frontend/content.json'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.