fastify / fastify-dx

Archived
901 stars 42 forks source link

How to configure polymorphic fetch #44

Closed simoneb closed 2 years ago

simoneb commented 2 years ago

Prerequisites

Issue

In one of the starters there is a fetch function configured as

export const $fetch = ky.extend({
  prefixUrl: 'http://localhost:3000',
})

This doesn't work when the application is deployed somewhere as the server needs to "call itself" and the client needs go to the right url where the application is running.

How do you handle this?