diff --git a/example/netlify.toml b/example/netlify.toml index 18426a4..d96cc8f 100644 --- a/example/netlify.toml +++ b/example/netlify.toml @@ -3,3 +3,8 @@ publish = "public/" [functions] external_node_modules = ["fsevents"] + +[[redirects]] +from = "/_gatsby/image/*" +to = "/.netlify/builders/gatsby" +status = 200 diff --git a/example/netlify/functions/gatsby.ts b/example/netlify/functions/gatsby.ts new file mode 100644 index 0000000..08eb5a8 --- /dev/null +++ b/example/netlify/functions/gatsby.ts @@ -0,0 +1,7 @@ +import { createIPXHandler } from '@netlify/ipx' + +export const handler = createIPXHandler({ + domains: ['images.unsplash.com'], + propsEncoding: 'base64', + basePath: '/_gatsby/image/' +}) diff --git a/example/netlify/functions/ipx.ts b/example/netlify/functions/ipx.ts index 00611d5..15236a5 100644 --- a/example/netlify/functions/ipx.ts +++ b/example/netlify/functions/ipx.ts @@ -2,5 +2,5 @@ import { createIPXHandler } from '@netlify/ipx' export const handler = createIPXHandler({ domains: ['images.unsplash.com'], - basePath: '/.netlify/functions/ipx/' + basePath: '/.netlify/builders/ipx/' }) diff --git a/example/public/index.html b/example/public/index.html index bcd1cfe..0283814 100644 --- a/example/public/index.html +++ b/example/public/index.html @@ -1,26 +1,37 @@ -
-