Improve local setup and README (#291)
This commit is contained in:
25
skyvern-frontend/localServer.js
Normal file
25
skyvern-frontend/localServer.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import { createServer } from "http";
|
||||
import handler from "serve-handler";
|
||||
import open from "open";
|
||||
|
||||
const port = 8080;
|
||||
const url = `http://localhost:${port}`;
|
||||
|
||||
const server = createServer((request, response) => {
|
||||
// You pass two more arguments for config and middleware
|
||||
// More details here: https://github.com/vercel/serve-handler#options
|
||||
return handler(request, response, {
|
||||
public: "dist",
|
||||
rewrites: [
|
||||
{
|
||||
source: "**",
|
||||
destination: "/index.html",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(8080, async () => {
|
||||
console.log(`Running at ${url}`);
|
||||
await open(url);
|
||||
});
|
||||
Reference in New Issue
Block a user