Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sodiray/exobase-js

A library that implements the Abstract & Compose design pattern, write you API or web service on any framework -- then switch.
https://github.com/sodiray/exobase-js

aws express gcp lambda nextjs node

Last synced: 7 days ago
JSON representation

A library that implements the Abstract & Compose design pattern, write you API or web service on any framework -- then switch.

Awesome Lists containing this project

README

        

# Exobase



radash





Typescript Framework for Node Web Services & APIs




Full Documentation



## Install

To keep your dependencies lean, Exobase is split into seperate packages for each hook (learn about hooks [here](https://exobase-js.vercel.app/docs/core-concepts#hooks)) + a core package. To install, you have two options.

1. Install everything. This is the easiest way to get started quickly.

```sh
yarn add @exobase/core @exobase/hooks
```

2. Only install what you need. If you only need the `useJsonArgs` and `useCors` hooks then only install those packages.

```sh
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.

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

## Getting Started

Using our [Express example project](./examples/callback-api-express) you can have an API running in a few minutes. Here's a simple health check endpoint.

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

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

export default compose(useExpress(), ping)
```