Add FastApi to work with Nextjs Api routes
This commit is contained in:
parent
9a88d6e746
commit
5a3a47d1f3
7 changed files with 370 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue