Skip to content

Commit 1506d3a

Browse files
authored
Create nanorobotics.js
1 parent 2af3a21 commit 1506d3a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

routes/nanorobotics.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import express from 'express';
2+
import * as NR from 'nanorobotics.js';
3+
4+
const router = express.Router();
5+
const nr = new NR.Nanorobotics();
6+
7+
router.post('/nanorobot-design', async (req, res) => {
8+
const { design } = req.body;
9+
const nanorobotDesign = await nr.design(design);
10+
res.json({ nanorobotDesign });
11+
});
12+
13+
router.post('/nanorobot-simulation', async (req, res) => {
14+
const { simulation } = req.body;
15+
const nanorobotSimulation = await nr.simulate(simulation);
16+
res.json({ nanorobotSimulation });
17+
});
18+
19+
router.post('/nanorobot-control', async (req, res) => {
20+
const { control } = req.body;
21+
const nanorobotControl = await nr.control(control);
22+
res.json({ nanorobotControl });
23+
});
24+
25+
export default router;

0 commit comments

Comments
 (0)