In webpack I could do something like to this to handle some development middleware code, which includes doing some work/testing inside the app.get call.
devServer: {
before: function (app, server) {
app.get ("/", function (req, resp, next) {
// Do some stuff
resp.redirect ("someUrl")
}
}
}
It seems like Vite should have some kind of similar functionality, but I have not found the right docs yet to help me out. Does anyone have an example of this for Vite?