Skip to content

Commit

Permalink
Create nanorobotics.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 22, 2024
1 parent 2af3a21 commit 1506d3a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions routes/nanorobotics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import express from 'express';
import * as NR from 'nanorobotics.js';

const router = express.Router();
const nr = new NR.Nanorobotics();

router.post('/nanorobot-design', async (req, res) => {
const { design } = req.body;
const nanorobotDesign = await nr.design(design);
res.json({ nanorobotDesign });
});

router.post('/nanorobot-simulation', async (req, res) => {
const { simulation } = req.body;
const nanorobotSimulation = await nr.simulate(simulation);
res.json({ nanorobotSimulation });
});

router.post('/nanorobot-control', async (req, res) => {
const { control } = req.body;
const nanorobotControl = await nr.control(control);
res.json({ nanorobotControl });
});

export default router;

0 comments on commit 1506d3a

Please sign in to comment.