Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/sodiray/exobase-js
- Owner: sodiray
- Created: 2021-12-04T14:28:17.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T10:08:47.000Z (4 months ago)
- Last Synced: 2024-08-18T09:52:21.581Z (3 months ago)
- Topics: aws, express, gcp, lambda, nextjs, node
- Language: TypeScript
- Homepage: exobase-js.vercel.app
- Size: 28.7 MB
- Stars: 18
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exobase
## 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)
```