Skip to content

Return Hyperscript Tagged Markup Views From AWS Lambda Functions

License

Notifications You must be signed in to change notification settings

Ankcorn/serverless-htm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless HTM (Hyperscript Tagged Markup)

hyperscript tagged markup demo

Render html components from aws lambdas by combining htm and vhtml.

  • Component Based - Create reusable snippets of html that can be used together
  • Minimalistic - Render these snippets of HTML in an AWS lambda function not the client for an optimum user experience
  • Explainable - No mysterious build steps required that make debugging impossible
  • Accessible - Create things that can run on any device "For The Next Billion web users"

If you want to learn more about building websites with serverless-htm message me on twitter

Installation

Download the serverless-htm from npm

npm i serverless-htm

Serverless HTM wraps the lambda function code and passes the return value into a template to be rendered by a browser.

const http = require('tiny-json-http');
const { html, view } = require('serverless-htm');

exports.handler = view(async(event) => {
  const { body } = await http.get('https://ghibliapi.herokuapp.com/films');
  return html`
    <h1>Studio Gibli Films</h1>
    <ul>
      ${body.map(({ name }) => html`<li>${name}</li>`)}
    </ul>
  `;
});

Usage

API

About

Return Hyperscript Tagged Markup Views From AWS Lambda Functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published