fastify / fastify/fastify-reply-from

Async getUpstream

Open
#408 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
166
Forks
103
Avg merge
4h 9m
Merged PRs (30d)
4

Description

### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have searched existing issues to ensure the feature has not already been requested

### 🚀 Feature Proposal

The `getUpstream` callback can be sync or async.

### Motivation

We have a (probably unusual) need for `getUpstream` to support async. We have a sophisticated tenancy strategy that requires us to reach out to dbs/caches/etc to resolve the correct upstream.

### Example

```
reply.from(/some/path', {
getUpstream: async () => { return await someAsyncFunc() }
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.