mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
26d2c190fc
* add test infra * improve test setup and utils * finish a test * add browser tests to ci * fix ci * fix ci * fix ci * fix ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * fix ci * update lockfile * fix formatting * install browser when not cached * bust cache * debug test in ci * fix button label * generate screenshots for failed tests * generate screenshots for failed tests * generate screenshots for failed tests * fix tests * clean uip debug logs * add setuip + teardown to functional tests * remove build from static checks
22 lines
531 B
JavaScript
22 lines
531 B
JavaScript
import polka from "polka";
|
|
import sirv from "sirv";
|
|
import path from "path";
|
|
import { dirname, join } 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("3000", () => {
|
|
console.log(`> Running on localhost: 3000`);
|
|
});
|
|
|
|
return () => {
|
|
app.server.close();
|
|
};
|
|
}
|