reporting

This commit is contained in:
ieb 2022-08-30 20:46:24 +08:00
parent 04e9827df6
commit a53994a718
2 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,14 @@
const nextConfig = { const nextConfig = {
reactStrictMode: true, reactStrictMode: true,
swcMinify: true, swcMinify: true,
async rewrites() {
return [
{
source: '/api/:path*',
destination: 'https://f1setup.deta.dev/:path*',
},
]
},
} }
module.exports = nextConfig module.exports = nextConfig

View File

@ -315,7 +315,7 @@ export function Calculator({ target }) {
) )
if (v === "optimal") { if (v === "optimal") {
fetch(`https://f1setup.deta.dev/report`, { fetch(`/api/report`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Accept': 'application/json', 'Accept': 'application/json',