fix formatting again

This commit is contained in:
Toshit Chawda 2024-07-14 18:25:21 -07:00
parent 774f3d5b5d
commit ddaea9b86a
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
36 changed files with 1720 additions and 1720 deletions

View file

@ -14,71 +14,71 @@ import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
import { bareModulePath } from "@mercuryworkshop/bare-as-module3";
const bare = createBareServer("/bare/", {
logErrors: true,
logErrors: true,
});
const fastify = Fastify({
serverFactory: (handler) => {
return createServer()
.on("request", (req, res) => {
if (bare.shouldRoute(req)) {
bare.routeRequest(req, res);
} else {
handler(req, res);
}
})
.on("upgrade", (req, socket, head) => {
if (bare.shouldRoute(req)) {
bare.routeUpgrade(req, socket, head);
} else {
socket.end();
}
});
},
serverFactory: (handler) => {
return createServer()
.on("request", (req, res) => {
if (bare.shouldRoute(req)) {
bare.routeRequest(req, res);
} else {
handler(req, res);
}
})
.on("upgrade", (req, socket, head) => {
if (bare.shouldRoute(req)) {
bare.routeUpgrade(req, socket, head);
} else {
socket.end();
}
});
},
});
fastify.register(fastifyStatic, {
root: join(fileURLToPath(new URL(".", import.meta.url)), "./static"),
decorateReply: false,
root: join(fileURLToPath(new URL(".", import.meta.url)), "./static"),
decorateReply: false,
});
fastify.register(fastifyStatic, {
root: join(fileURLToPath(new URL(".", import.meta.url)), "./dist"),
prefix: "/scram/",
decorateReply: false,
root: join(fileURLToPath(new URL(".", import.meta.url)), "./dist"),
prefix: "/scram/",
decorateReply: false,
});
fastify.register(fastifyStatic, {
root: baremuxPath,
prefix: "/baremux/",
decorateReply: false,
root: baremuxPath,
prefix: "/baremux/",
decorateReply: false,
});
fastify.register(fastifyStatic, {
root: epoxyPath,
prefix: "/epoxy/",
decorateReply: false,
root: epoxyPath,
prefix: "/epoxy/",
decorateReply: false,
});
fastify.register(fastifyStatic, {
root: libcurlPath,
prefix: "/libcurl/",
decorateReply: false,
root: libcurlPath,
prefix: "/libcurl/",
decorateReply: false,
});
fastify.register(fastifyStatic, {
root: bareModulePath,
prefix: "/baremod/",
decorateReply: false,
root: bareModulePath,
prefix: "/baremod/",
decorateReply: false,
});
fastify.listen({
port: process.env.PORT || 1337,
port: process.env.PORT || 1337,
});
const watch = spawn("pnpm", ["rspack", "-w"], {
detached: true,
cwd: process.cwd(),
detached: true,
cwd: process.cwd(),
});
watch.stdout.on("data", (data) => {
console.log(`${data}`);
console.log(`${data}`);
});
watch.stderr.on("data", (data) => {
console.log(`${data}`);
console.log(`${data}`);
});