Coder Social home page Coder Social logo

serverless-htm's Introduction

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

serverless-htm's People

Contributors

ankcorn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.