-
Notifications
You must be signed in to change notification settings - Fork 44
/
next.config.js
97 lines (96 loc) · 2.5 KB
/
next.config.js
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
const withMDX = require('@next/mdx')({ extension: /\.mdx?$/ })
module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'mdx'],
trailingSlash: false,
images: {
imageSizes: [18, 36, 54, 24, 48, 72, 96, 144],
domains: [
'dl.airtable.com',
'emoji.slack-edge.com',
'cloud-lp0r5yk68.vercel.app',
'avatars.slack-edge.com',
'secure.gravatar.com',
'i.imgur.com',
'www.gravatar.com',
'ca.slack-edge.com',
'scrapbook-into-the-redwoods.s3.amazonaws.com',
'scrapbook-into-the-redwoods.s3.us-east-1.amazonaws.com'
]
},
async rewrites() {
return [
{ source: '/summer', destination: '/r/summer-of-making' },
{ source: '/new', destination: '/' },
{
source: '/attachments/:path*{/}?',
destination: 'https://dl.airtable.com/.attachmentThumbnails/:path*'
},
{
source: '/customizer',
destination: 'https://scrapbook-customizer.vercel.app/'
},
{
source: '/customizer/(.*)',
destination: 'https://scrapbook-customizer.vercel.app/$1'
},
{
source: '/avatar/(.*)',
destination: 'https://scrapbook.hackclub.com/api/users/$1/avatar'
},
{
source: '/(.*).png',
destination: 'https://scrapbook.hackclub.com/api/users/$1/avatar'
},
{
source: '/api/emoji',
destination: 'https://badger.hackclub.dev/api/emoji'
},
{
source: '/:username.rss',
destination: '/api/rss/:username'
},
{
source: '/auth/error:path*{/}',
destination: '/404'
}
]
},
async headers() {
return [
{
source: '/(.*)',
headers: [{ key: 'Access-Control-Allow-Origin', value: '*' }]
},
{
source: '/api/emoji',
headers: [
{
key: 'Cache-Control',
value: 'max-age=1000, stale-while-revalidate'
}
]
},
{
source: "/api/css",
headers: [
{
key: "Content-Type",
value: "text/css;charset=UTF-8"
}
]
},
{
source: '/attachments/(.+)',
headers: [
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET, OPTIONS' },
{ key: 'Access-Control-Allow-Headers', value: 'Content-Type' },
{
key: 'Cache-Control',
value: 'public, max-age=60000, immutable'
}
]
}
]
}
})