Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpalumickas committed Oct 23, 2024
1 parent 6d88921 commit 2a6ccc1
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 12 deletions.
1 change: 0 additions & 1 deletion docs/pages/analyzers/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ example, you can add `afterAttach` callback to Uplo and schedule a blob analyze
job.

```ts

const uplo = Uplo({
callbacks: {
afterAttach: async ({ blob }) => {
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/client/react-native.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Install for Expo

```sh
yarn add @uplo/react-native expo-file-system
```sh npm2yarn
npm i @uplo/react-native expo-file-system
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/client/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Installation

```sh
yarn add @uplo/react
```sh npm2yarn
npm i @uplo/react
```

## Usage
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ or etc. It also supports various type of ORM adapters, like Prisma.

## Getting started

Add `@uplo/node` to your package.json
Add `@uplo/server` (or `@uplo/node` if using Node) to your package.json

```sh npm2yarn
npm i @uplo/node
npm i @uplo/server
```

Install Adapter (for example Prisma)
Expand All @@ -34,9 +34,9 @@ npm i @uplo/service-s3
Define uplo instance

```ts
import Uplo from '@uplo/node';
import Uplo from '@uplo/server';
import PrismaAdapter from '@uplo/adapter-prisma';
import GCSService from '@uplo/service-gcs';
import S3Service from '@uplo/service-s3';

const config = {
privateKey: process.env.APPLICATION_SECRET, // Used to sign direct upload keys
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/server/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
node: 'Node',
fastify: 'Fastify',
};
6 changes: 3 additions & 3 deletions docs/pages/server/fastify.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Fastify

This adds direct upload routes.
Using Fastify package adds routes for direct uploads.

```sh
yarn add @uplo/fastify
```sh npm2yarn
npm i @uplo/fastify
```

```ts
Expand Down
32 changes: 32 additions & 0 deletions docs/pages/server/node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Node

```sh npm2yarn
npm i @uplo/node
```

```ts
import Uplo from '@uplo/node';
import PrismaAdapter from '@uplo/adapter-prisma';
import GCSService from '@uplo/service-gcs';

const config = {
privateKey: process.env.APPLICATION_SECRET, // Used to sign direct upload keys
signedIdExpiresIn: 60 * 60, // Time how long a Signed ID is valid
};

const uplo = Uplo({
config,
adapter: new PrismaAdapter({ prisma }),
services: {
s3: S3Service({
isPublic: false,
region: process.env.AWS_REGION,
bucket: process.env.AWS_BUCKET,
accessKeyId: '*****',
secretAccessKey: '*****',
}),
},
attachments: {
},
});
```

0 comments on commit 2a6ccc1

Please sign in to comment.