Add FastApi to work with Nextjs Api routes

This commit is contained in:
Diego Valdez 2023-05-26 09:35:06 -06:00
commit 5a3a47d1f3
7 changed files with 370 additions and 11 deletions

View file

@ -1,4 +1,16 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
rewrites: async () => {
return [
{
source: "/api/:path*",
destination:
process.env.NODE_ENV === "development"
? "http://127.0.0.1:8000/api/:path*"
: "/api/",
},
];
},
};
module.exports = nextConfig
module.exports = nextConfig;