2022-03-25 19:17:37 +00:00
|
|
|
// https://www.npmjs.com/package/next-transpile-modules
|
|
|
|
// This makes our @calcom/prisma package from the monorepo to be transpiled and usable by API
|
2022-03-25 18:37:51 +00:00
|
|
|
const withTM = require("next-transpile-modules")([
|
|
|
|
"@calcom/prisma",
|
|
|
|
]);
|
|
|
|
|
2022-03-25 19:17:37 +00:00
|
|
|
// use something like withPlugins([withTM], {}) if more plugins added later.
|
2022-03-25 18:37:51 +00:00
|
|
|
|
|
|
|
module.exports = withTM({
|
2022-03-23 21:22:57 +00:00
|
|
|
async rewrites() {
|
|
|
|
return [
|
|
|
|
// This redirects requests recieved at / the root to the /api/ folder.
|
|
|
|
{
|
|
|
|
source: "/:rest*",
|
|
|
|
destination: "/api/: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",
|
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
2022-03-25 18:37:51 +00:00
|
|
|
});
|