gradio/ui/playwright-setup.js
pngwn 669ee42c8f
fix space embeds using src attribute (#3065)
* change ports in dev mode

* changelog

* correctly detect space embeds

* changelog

* formatting
2023-01-27 14:39:36 +00:00

22 lines
525 B
JavaScript

import polka from "polka";
import sirv from "sirv";
import path from "path";
import { dirname } from "path";
import { fileURLToPath } from "url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const template = path.join(__dirname, "..", "gradio", "templates", "frontend");
export default async function global_setup() {
const serve = sirv(template);
const app = polka()
.use(serve)
.listen("9876", () => {
console.log(`> Running on localhost: 9876`);
});
return () => {
app.server.close();
};
}