Skip to content

Comments for static sites and authenticated users deployed as AWS Lambda

Notifications You must be signed in to change notification settings

davidayalas/jamstack-lambda-comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Context

  • This lambda is based on the idea behind of https://staticman.net/ for publising comments into static sites.
  • Is compatible with github.com and gitlab.com APIs.
  • It expects an "user" in the event.requestContext.authorizer.user (in my PoCs request are authorized with JWT/AWS API GW Custom Authorizer)

Environment variables

  • PROJECTID: required
  • OWNER: required, for github repos only
  • TOKEN: required
  • TYPE: "gitlab" or "github", default to gitlab
  • AUTHOR: for commit info, optional
  • COMMIT_MESSAGE: optional

Filepath

The new file will be named like this:

https://[repo api endpoint]/data/comments/[body.item]/[user from authorizer]-[timestamp].json

You have to send in the POST message a field named "item" with the item that is being commented (url encoded).

Releases

No releases published

Packages

No packages published