File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
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 ;
You can’t perform that action at this time.
0 commit comments