Skip to content

Instantly share code, notes, and snippets.

@rjpkuyper
Created February 17, 2023 06:20
Show Gist options
  • Save rjpkuyper/4951271b2838b3dee8d503abcaf6bc11 to your computer and use it in GitHub Desktop.
Save rjpkuyper/4951271b2838b3dee8d503abcaf6bc11 to your computer and use it in GitHub Desktop.
export enum Paths {
PRODUCTS = '/products'
}
export const createUrl = (path: Paths) => `${process.env.BASE_URL}${path}`
export const productsUrl = createUrl(Paths.PRODUCTS)
export const getProducts = () => fetch(productsUrl).then(e => e.json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment