serverless-htm

0.0.7 • Public • Published

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

Package Sidebar

Install

npm i serverless-htm

Weekly Downloads

7

Version

0.0.7

License

Apache-2.0

Unpacked Size

18.3 kB

Total Files

8

Last publish

Collaborators

  • thomasankcorn