0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-26 13:53:02 +00:00

start changing imports

This commit is contained in:
Víctor Losada Hernández
2026-01-24 00:04:32 +01:00
parent 44b8ff8cd2
commit eda1fb29c6
9 changed files with 132 additions and 53 deletions

View File

@@ -10,12 +10,12 @@ const app = express();
async function start() {
const vite = await createViteServer({
server: { middlewareMode: true },
root: path.resolve(__dirname, "../client"),
root: __dirname,
appType: "custom",
});
app.use(vite.middlewares);
app.use("/assets", express.static(path.resolve(__dirname, "../client/assets")));
app.use("/assets", express.static(path.resolve(__dirname, "/client/assets")));
app.use(/(.*)/, async (req, res, next) => {
try {
@@ -27,7 +27,7 @@ async function start() {
const entry = pathname.startsWith("/admin") ? "admin" : "homebrew";
const ssrModule = await vite.ssrLoadModule(`/${entry}/${entry}.jsx`);
const ssrModule = await vite.ssrLoadModule(`client/${entry}/${entry}.jsx`);
const html = await template(entry, "", { path: pathname, ssrModule });
res.status(200).set({ "Content-Type": "text/html" }).end(html);