Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5056

Next.js Redirects in next.config.js dynamicly

$
0
0

I want to update Redirects routes after build of project. So, we have a redirect routes on BE Api.

I want to get it and implement to next.config.js dynamicly, here what i tried to do.

const getUrls = () =>    new Promise(resolve => {        setTimeout(() => resolve(fetch("https://api.mocki.io/v1/a0b7f0b0").then(function(response) {            return response.json();          }).then(function(data) {            return data.data;          }) ), 3000);    });    // ExampleResponse = {    //     "data":[    //         {    //             "source":"/test",    //             "permanent":true,    //             "destination":"/internet-application"    //         }    //     ]    // }module.exports = {    poweredByHeader: false,    async redirects() {        return getUrls();      },}

Is there any solution to do it like that. I just want to update redirects from database.If the database update can we trigger redirects without stop project


Viewing all articles
Browse latest Browse all 5056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>