fastify-dx icon indicating copy to clipboard operation
fastify-dx copied to clipboard

How to configure polymorphic fetch

Open simoneb opened this issue 3 years ago • 0 comments
trafficstars

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the issue has not already been raised

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?

simoneb avatar Jul 30 '22 16:07 simoneb