0.0.7 • Published 3 years ago

serverless-htm v0.0.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

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

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago