<@UFT11FKSP> Do you or anyone else know of a guide...
# multiplatform
u
@Robert Jaros Do you or anyone else know of a guide that explains this a little bit more in depth. I struggle with the exact same problem as Erik. I created a new Project the same way and ran
jsBrowserDevelopmentRun --continuous
+
jvmRun -DmainClass=application.ServerKt --quiet
I added a folder webpack.config.d to the project root and added a 01.devServer.js with the following contents:
Copy code
;(function (config) {
    const shouldRunServer = config.mode !== "production"
    const serverUrl = '<http://127.0.0.1:8081>'
    if (shouldRunServer) {
        config.devServer = config.devServer || {}
        config.devServer.proxy = {
            '/': {
                target: serverUrl,
                secure: false,
                bypass: function (req, res, proxyOptions) {
                    if (req.headers.accept.indexOf('.js') !== -1) {
                        return req.headers.accept;
                    }
                }
            }
        }
    }
})(config);
where my Server.kt looks like
Copy code
fun main() {
    embeddedServer(Netty, port = 8081, host = "127.0.0.1") {
        routing {
            get("/") {
                call.respondHtml(HttpStatusCode.OK, HTML::index)
            }
            static("/static") {
                resources()
            }
        }
    }.start(wait = true)
}
The result is that I get redirected from localhost:8080 to 8081 where my server serves content and I can see in the gradle process window that after a change he updates, but on page reload nothing happens, until I restart the server. So the webpack-dev-server seems to "only" redirect.