0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset/dry-worms-knock.md
Erika 518433e433
feat(assets): Allow customising the route of the image endpoint (#11908)
* feat(assets): Allow customizing the route of the image endpoint

* Update packages/astro/src/core/config/schema.ts

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* feat: use undefined instead of default

* fix: strip param correctly on custom endpoint route

* chore: changeset

* nit: unused import

* fix: other unused import

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-09-11 01:04:16 +02:00

451 B

astro
major

The image.endpoint config now allow customizing the route of the image endpoint in addition to the entrypoint. This can be useful in niche situations where the default route /_image conflicts with an existing route or your local server setup.

import { defineConfig } from "astro/config";

defineConfig({
  image: {
    endpoint: {
      route: "/image",
      entrypoint: "./src/image_endpoint.ts"
    }
  },
})