const { createProxyMiddleware } = require("http-proxy-middleware");

module.exports = function (app) {
  app
    .use(
      createProxyMiddleware("/qwilight/www", {
        target: process.env.API ?? "https://taehui.ddns.net",
        changeOrigin: true,
      }),
    )
    .use(
      createProxyMiddleware("/qwilight/ws", {
        target: process.env.WS_API ?? "wss://taehui.ddns.net",
        changeOrigin: true,
        ws: true,
      }),
    );
};
