feat: add module build service with nasher compile and pack
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user