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
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>
`;
});