feat: add module build service with nasher compile and pack

This commit is contained in:
plenarius
2026-04-20 19:50:07 -04:00
parent b7177a8fd7
commit 59909a7b48
3 changed files with 71 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { Router } from "express";
import { buildModule } from "../services/build.service.js";
const router = Router();
router.post("/module/compile", async (req, res) => {
const target = req.body.target || "bare";
try {
const result = await buildModule(target, "compile");
res.json(result);
} catch (err: any) {
res.status(500).json({ error: err.message });
}
});
router.post("/module/pack", async (req, res) => {
const target = req.body.target || "bare";
try {
const result = await buildModule(target, "pack");
res.json(result);
} catch (err: any) {
res.status(500).json({ error: err.message });
}
});
export default router;