2019-11-09 23:34:53 +01:00
|
|
|
module.exports = {
|
2019-11-10 05:00:54 +01:00
|
|
|
// target: 'serverless',
|
2019-11-09 23:34:53 +01:00
|
|
|
experimental: {
|
2019-11-11 04:24:53 +01:00
|
|
|
async rewrites() {
|
2019-11-09 23:34:53 +01:00
|
|
|
return [
|
2019-11-18 01:12:48 +01:00
|
|
|
{
|
|
|
|
source: '/hello-world',
|
|
|
|
destination: '/static/hello.txt',
|
|
|
|
},
|
2019-11-09 23:34:53 +01:00
|
|
|
{
|
|
|
|
source: '/',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/another',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/another',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/multi-rewrites',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/first',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/hello',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/second',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/hello-again',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/test/:path',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/:path',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/test-overwrite/:something/:another',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/params/this-should-be-the-value',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/params/:something',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/with-params',
|
|
|
|
},
|
2019-11-09 23:34:53 +01:00
|
|
|
]
|
|
|
|
},
|
2019-11-11 04:24:53 +01:00
|
|
|
async redirects() {
|
2019-11-09 23:34:53 +01:00
|
|
|
return [
|
2019-11-18 01:12:48 +01:00
|
|
|
{
|
|
|
|
source: '/docs/router-status/:code',
|
|
|
|
destination: '/docs/v2/network/status-codes#:code',
|
|
|
|
statusCode: 301,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/docs/github',
|
|
|
|
destination: '/docs/v2/advanced/now-for-github',
|
|
|
|
statusCode: 301,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/docs/v2/advanced/:all(.*)',
|
|
|
|
destination: '/docs/v2/more/:all',
|
|
|
|
statusCode: 301,
|
|
|
|
},
|
2019-11-09 23:34:53 +01:00
|
|
|
{
|
|
|
|
source: '/hello/:id/another',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/blog/:id',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redirect1',
|
2019-11-11 04:24:53 +01:00
|
|
|
destination: '/',
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redirect2',
|
|
|
|
destination: '/',
|
2019-11-11 04:24:53 +01:00
|
|
|
statusCode: 301,
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redirect3',
|
|
|
|
destination: '/another',
|
2019-11-11 04:24:53 +01:00
|
|
|
statusCode: 302,
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redirect4',
|
|
|
|
destination: '/',
|
2019-11-11 04:24:53 +01:00
|
|
|
statusCode: 308,
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redir-chain1',
|
|
|
|
destination: '/redir-chain2',
|
2019-11-11 04:24:53 +01:00
|
|
|
statusCode: 301,
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redir-chain2',
|
|
|
|
destination: '/redir-chain3',
|
2019-11-11 04:24:53 +01:00
|
|
|
statusCode: 302,
|
2019-11-09 23:34:53 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
source: '/redir-chain3',
|
|
|
|
destination: '/',
|
2019-11-11 04:24:53 +01:00
|
|
|
statusCode: 303,
|
|
|
|
},
|
2019-11-09 23:34:53 +01:00
|
|
|
]
|
2019-11-11 04:24:53 +01:00
|
|
|
},
|
|
|
|
},
|
2019-11-09 23:34:53 +01:00
|
|
|
}
|