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.
- Install everything. This is the easiest way to get started quickly.
yarn add @exobase/core @exobase/hooks
- Only install what you need. If you only need the
useJsonArgs
anduseCors
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)