This commit is contained in:
MotorTruck1221 2024-08-18 00:21:03 -06:00
parent 5ae0aad1d6
commit 3b00a749b5
No known key found for this signature in database
GPG key ID: 08F417E2B8B61EA4
13 changed files with 5887 additions and 2913 deletions

View file

@ -1,6 +1,7 @@
import express from "express";
import { createServer } from "node:http";
import path from "path";
import wisp from "wisp-server-node";
import { Sequelize, DataTypes } from "sequelize";
import { fileURLToPath } from "url";
import { handler as ssrHandler } from "./dist/server/entry.mjs";
@ -176,6 +177,13 @@ server.on("request", (req, res) => {
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
app(req, res);
});
server.on("upgrade", (req, socket, head) => {
if (req.url.endsWith("/wisp/")) {
wisp.routeRequest(req, socket, head);
}
})
server.listen({
port: 8080,
});