A library that implements the Abstract & Compose design pattern, write you API or web service on any framework -- then switch.
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.
yarn add @exobase/core @exobase/hooks
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
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)