Skip to content

Commit

Permalink
Merge pull request #400 from nickbabcock/docs-fix
Browse files Browse the repository at this point in the history
Fix docs syntax for proxy routeRules
  • Loading branch information
nksaraf authored Oct 22, 2024
2 parents 46303e7 + 5c857b3 commit 71ba1f3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docs/guide/route-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ export default createApp({
server: {
routeRules: {
"/_build/assets/**": { headers: { "cache-control": "s-maxage=0" } },
"/api/v1/**": {
cors: true,
headers: { "access-control-allow-methods": "GET" },
},
"/old-page": { redirect: "/new-page" },
"/proxy/example": { proxy: "https://example.com" },
"/proxy/**": { proxy: "/api/**" },
'/blog/**': { swr: true },
'/blog/**': { swr: 600 },
'/blog/**': { static: true },
'/blog/**': { cache: { /* cache options*/ } },
'/assets/**': { headers: { 'cache-control': 's-maxage=0' } },
'/api/v1/**': { cors: true, headers: { 'access-control-allow-methods': 'GET' } },
'/old-page': { redirect: '/new-page' }, // uses status code 307 (Temporary Redirect)
'/old-page2': { redirect: { to:'/new-page2', statusCode: 301 } },
'/old-page/**': { redirect: '/new-page/**' },
'/proxy/example': { proxy: 'https://example.com' },
'/proxy/**': { proxy: '/api/**' },
},
},
routers: [
Expand Down

0 comments on commit 71ba1f3

Please sign in to comment.