Skip to content

Commit

Permalink
#2 - Added Item upload endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikpyt committed Sep 28, 2023
1 parent b92e6f1 commit 5da110d
Show file tree
Hide file tree
Showing 24 changed files with 1,405 additions and 231 deletions.
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ DATABASE_URL="${DATABASE_URL_WITHOUT_SCHEMA}/${DATABASE_NAME}"
DATABASE_URL_NON_POOLING="${DATABASE_URL_WITHOUT_SCHEMA}/${DATABASE_NAME}"

# Redis
REDIS_HOST="redis"
REDIS_HOST="localhost"
REDIS_PORT="6379"
REDIS_USER=""
REDIS_PASSWORD=""
REDIS_URL="rediss://${REDIS_USER}:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}"
REDIS_URL="redis://${REDIS_USER}:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}"

# Vercel Blob Storage
BLOB_READ_WRITE_TOKEN="vercel_blob_rw_0511953119b0c1167283c7453a088727" # Fake vercel token
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
--health-timeout 5s
--health-retries 5
env:
BLOB_READ_WRITE_TOKEN: 'vercel_blob_rw_0511953119b0c1167283c7453a088727' # Fake vercel token
DATABASE_URL: 'postgresql://postgres_user:postgres_password@localhost:5432/postgres_db'
DATABASE_URL_NON_POOLING: 'postgresql://postgres_user:postgres_password@localhost:5432/postgres_db'
DATABASE_URL_WITHOUT_SCHEMA: 'postgresql://postgres_user:postgres_password@localhost:5432'
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,35 @@ Deploys the pending migrations to the databases.

To learn Fastify, check out the [Fastify documentation](https://www.fastify.io/docs/latest/).

## Setup blob storage connection locally

### Install & run ngrok

Head to https://ngrok.com/download and download ngrok for your operating system.

**Beware:** If you are using WSL on Windows, you can just follow the linux guide and set it up in your WSL.

Now create a ngrok tunnel to your API:

```sh
ngrok http 3000

# Example using a static domain. This is highly recommended
ngrok http --domain=healthy-monkey-dancing.ngrok-free.app 3000
```

I recommend heading to https://dashboard.ngrok.com/cloud-edge/domains and creating a static domain, so you won't have to update your `.env` file in the web application every time you create a new tunnel.

### Setup .env files

#### API

Set the `BLOB_READ_WRITE_TOKEN` variable to the one from vercel.

#### Web

Set the `PUBLIC_API_URL` variable to the ngrok tunnel url. Example: `PUBLIC_API_URL="https://healthy-monkey-dancing.ngrok-free.app/api/"`

## Generate Ed25519 key pair

```bash
Expand Down
Loading

0 comments on commit 5da110d

Please sign in to comment.