trimpirim / serverless-use

Collection of Serverless composable utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ServerlessUse - Collection of Serverless Composable Utilities
Collection of Serverless Composable Utilities

Serverless Use Docs

πŸ‘€ Features

  • 🎻 Composable functions for common tasks
  • ⚠️ Global Error handling
  • πŸ’» Strict Execution scope
  • πŸ—œοΈ Automatic Response Compression
  • πŸ€– Automatic Handlers Result Transform
  • ⌨️ Built with TypeScript providing TypeSafe options for all composables

πŸŽ‰ Usage

import { use, useQueryParameters } from '@serverless-use/apigw'

export const handler = use(async () => {
  const { queryParameters } = useQueryParameters()
  const { name } = queryParameters

  return {
    statusCode: 200,
    headers: {
      'Content-Type': 'text/html',
    },
    body: /*html*/ `
      <body style="display: grid; place-content: center;">
        <h1 style="text-align:center;">Welcome ${name}!</h1>
        <img src="https://i.giphy.com/media/mx9fVEF08tyne/giphy.gif">
      </body>`,
  }
})

πŸ“¦ Install

npm i @serverless-use/apigw

πŸ’“ Thanks

This project is based on VueUse

About

Collection of Serverless composable utilities


Languages

Language:TypeScript 99.6%Language:CSS 0.4%