feat: add axiom

pull/9078/head
Agusti Fernandez Pardo 2022-07-08 02:00:00 +02:00
parent a5976ec5c6
commit 599dccdcce
1 changed files with 29 additions and 26 deletions

View File

@ -13,30 +13,33 @@ const withTM = require("next-transpile-modules")([
"@calcom/embed-core", "@calcom/embed-core",
"@calcom/embed-snippet", "@calcom/embed-snippet",
]); ]);
const { withAxiom } = require("next-axiom");
module.exports = withTM({ module.exports = withAxiom(
async rewrites() { withTM({
return { async rewrites() {
afterFiles: [ return {
// This redirects requests recieved at / the root to the /api/ folder. afterFiles: [
{ // This redirects requests recieved at / the root to the /api/ folder.
source: "/v:version/:rest*", {
destination: "/api/v:version/:rest*", source: "/v:version/:rest*",
}, destination: "/api/v:version/:rest*",
// This redirects requests to api/v*/ to /api/ passing version as a query parameter. },
{ // This redirects requests to api/v*/ to /api/ passing version as a query parameter.
source: "/api/v:version/:rest*", {
destination: "/api/:rest*?version=:version", source: "/api/v:version/:rest*",
}, destination: "/api/:rest*?version=:version",
], },
fallback: [ ],
// These rewrites are checked after both pages/public files fallback: [
// and dynamic routes are checked // These rewrites are checked after both pages/public files
{ // and dynamic routes are checked
source: "/:path*", {
destination: `/api/:path*`, source: "/:path*",
}, destination: `/api/:path*`,
], },
}; ],
}, };
}); },
})
);