cal.pub0.org/next.config.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

// https://www.npmjs.com/package/next-transpile-modules
// This makes our @calcom/prisma package from the monorepo to be transpiled and usable by API
const withTM = require("next-transpile-modules")([
"@calcom/app-store",
2022-06-14 21:13:59 +00:00
"@calcom/core",
"@calcom/ee",
2022-06-14 21:13:59 +00:00
"@calcom/lib",
"@calcom/prisma",
"@calcom/stripe",
"@calcom/ui",
"@calcom/emails",
"@calcom/embed-core",
"@calcom/embed-snippet",
]);
module.exports = withTM({
2022-03-23 21:22:57 +00:00
async rewrites() {
return {
2022-06-14 20:07:23 +00:00
afterFiles: [
// This redirects requests recieved at / the root to the /api/ folder.
{
source: "/v:version/:rest*",
destination: "/api/v:version/:rest*",
},
// This redirects requests to api/v*/ to /api/ passing version as a query parameter.
{
source: "/api/v:version/:rest*",
destination: "/api/:rest*?version=:version",
},
],
fallback: [
// These rewrites are checked after both pages/public files
// and dynamic routes are checked
{
source: "/:path*",
destination: `/api/:path*`,
},
],
};
2022-03-23 21:22:57 +00:00
},
});