Improve local setup and README (#291)

This commit is contained in:
Salih Altun
2024-05-09 20:21:13 +03:00
committed by GitHub
parent ebfc1a6f0f
commit 240551f686
6 changed files with 292 additions and 4 deletions

View 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);
});