main
ali-f 1 month ago
parent 0e2e09c8d5
commit 97c6de259c
  1. 3
      controller/serialPort.js
  2. 4
      services/serialPortService.js

@ -1,11 +1,8 @@
import { Router } from 'express'; import { Router } from 'express';
import serialPort from '../services/serialPortService.js';
import serialPortList from '../services/serialPortService.js'; import serialPortList from '../services/serialPortService.js';
const router = new Router() const router = new Router()
router.get('/open/:id', serialPortList); router.get('/open/:id', serialPortList);
// router.get('/list/:id', serialPortList);
// router.get('/open/:id', serialPort);
export default router export default router

@ -1,10 +1,6 @@
import { SerialPort } from 'serialport' import { SerialPort } from 'serialport'
import res from "express/lib/response.js";
import { autoDetect } from '@serialport/bindings-cpp' import { autoDetect } from '@serialport/bindings-cpp'
async function serialPortList(req, res) { async function serialPortList(req, res) {
SerialPort.list() SerialPort.list()

Loading…
Cancel
Save