Exobase hook to help wire up response caching


Keywords
aws, express, gcp, lambda, nextjs, node
License
MIT
Install
npm install @exobase/use-cached-response@1.0.0-rc.2

Documentation

Exobase

radash

Typescript Framework for Node Web Services & APIs

Install

To keep your dependencies lean, Exobase is split into seperate packages for each hook (learn about hooks here) + a core package. To install, you have two options.

  1. Install everything. This is the easiest way to get started quickly.
yarn add @exobase/core @exobase/hooks
  1. Only install what you need. If you only need the useJsonArgs and useCors hooks then only install those packages.
yarn add @exobase/use-json-args @exobase/use-cors

A lot of thought and effort is put into keeping the hooks small, minimal, and lean. The root hooks however typically depend on the framework libraries so you'll want to make sure you're only installing the specific ones you need.

yarn add @exobase/use-lambda
yarn add @exobase/use-express
yarn add @exobase/use-next

Getting Started

Using our Express example project you can have an API running in a few minutes. Here's a simple health check endpoint.

import { compose } from 'radash'
import type { Props } from '@exobase/core'
import { useExpress } from '@exobase/use-express'

export const ping = async ({ args, services }: Props<Args, Services>) => {
  return {
    message: 'pong'
  }
}

export default compose(useExpress(), ping)