Home

Issue: 1509

Add HMR or automatic server restart for modified serverMiddleware scripts

[issue link]

Hi

The use case is that I am developing some back-end APIs for my app. To do that I use serverMiddleware and leverage the express router to implement my APIs. The config looks like this:

nuxt.config.js

    serverMiddleware: [
        '~/api/index.js',
    ]

So, each time I make changes to and save /api/index.js, or any scripts it imports, I would like the server portion of the app to reload/restart and use the latest code, just like the scripts in pages and components folders do.

However, currently that is not the case. I have to manually restart NUXT each time I want to test my changes, which is quite slow.

This feature request is available on Nuxt.js community (#c1344)