first commit

This commit is contained in:
锦恢 2024-10-16 16:25:05 +08:00
parent 7031d45909
commit b8fc82c33f

View File

@ -32,6 +32,8 @@ app.get('/', (req: Request, res: Response) => {
app.post('/save-view', async (req: Request, res: Response) => { app.post('/save-view', async (req: Request, res: Response) => {
try { try {
const { file, payload } = req.body; const { file, payload } = req.body;
console.log(payload);
const savePath = path.join(rootPath, file); const savePath = path.join(rootPath, file);
const buffer = BSON.serialize(payload); const buffer = BSON.serialize(payload);
fs.writeFileSync(savePath, buffer); fs.writeFileSync(savePath, buffer);