-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnext.config.mjs
More file actions
147 lines (144 loc) · 4.46 KB
/
Copy pathnext.config.mjs
File metadata and controls
147 lines (144 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
transpilePackages: ['@fiber-pay/sdk', '@nervosnetwork/fiber-js'],
async headers() {
return [
{
source: '/labs/browser-node',
headers: [
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },
],
},
{
source: '/docs/build/connect-wasm-node',
headers: [
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },
],
},
{
source: '/docs/build/open-channel-payment',
headers: [
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },
],
},
{
source: '/docs/build/multi-hop-invoice',
headers: [
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },
],
},
{
source: '/docs/build/unidirectional-channel',
headers: [
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },
],
},
...[
'/docs/build/hold-invoice',
'/docs/build/encrypted-data-payment',
'/docs/build/verified-result-payment',
'/docs/build/rusd-payment',
'/docs/build/close-channel',
].map((source) => ({
source,
headers: [
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },
],
})),
];
},
async redirects() {
return [
{
source: '/docs/build/verified-agent-job',
destination: '/docs/build/verified-result-payment',
permanent: true,
},
{
source: '/downloads/fiber-verified-agent-job.zip',
destination: '/downloads/fiber-verified-result-payment.zip',
permanent: true,
},
{
source: '/docs/build/channel-rebalancing',
destination: '/docs/build/unidirectional-channel',
permanent: false,
},
{
source: '/docs/build/wasm-dapp',
destination: '/docs/build/connect-wasm-node',
permanent: false,
},
{
// Moved under Build -> Gaming
source: '/docs/build/simple-game',
destination: '/docs/build/gaming/simple-game',
permanent: true,
},
{
source: '/docs/res/fiber-js-browser-extension',
destination: '/docs/build/browser-extension',
permanent: true,
},
{
source: '/docs/res/liquidity',
destination: '/docs/concept/liquidity/overview',
permanent: true,
},
{
source: '/docs/build/directional-liquidity',
destination: '/docs/concept/liquidity/directional-liquidity',
permanent: true,
},
{
source: '/docs/build/route-liquidity',
destination: '/docs/concept/liquidity/route-liquidity',
permanent: true,
},
{
source: '/docs/build/rebalance-liquidity',
destination: '/docs/concept/liquidity/rebalance-liquidity',
permanent: true,
},
{
// Preserve links from before the documentation restructure.
source: '/docs/tech-explanation/high-level',
destination: '/docs/res/high-level',
permanent: true,
},
{
// Preserve links from before the documentation restructure.
source: '/docs/tech-explanation/invoice-protocol',
destination: '/docs/res/invoice-protocol',
permanent: true,
},
{
// This archived devlog predates the current rolling API window.
source: '/blog/d/3fa6fcf8f94a1aa6',
destination: 'https://github.com/nervosnetwork/fiber/discussions/735',
permanent: true,
},
{
// Keep the Devlog linked from Pulse 01 reachable from old bookmarks.
source: '/blog/d/1994384f43a636e5',
destination: 'https://github.com/nervosnetwork/fiber/discussions/1170',
permanent: true,
},
{
source: '/contact',
destination: '/',
permanent: true,
},
];
},
};
export default withMDX(config);