LinkList/frontend/next.config.js

30 lines
606 B
JavaScript
Raw Normal View History

// @ts-check
/* eslint-disable @typescript-eslint/no-var-requires */
// eslint-disable-next-line no-undef
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");
const devConfig = {
async rewrites() {
return [
{
source: "/api",
2021-04-02 16:14:50 -04:00
destination: "http://localhost:5000",
},
{
2021-04-02 16:14:50 -04:00
source: "/api/:path*",
destination: "http://localhost:5000/:path*",
},
];
},
};
const prodConfig = {
2021-05-16 07:36:25 -04:00
basePath: "/links",
};
// eslint-disable-next-line no-undef
module.exports = (phase) =>
phase === PHASE_DEVELOPMENT_SERVER ? devConfig : prodConfig;