mirror of
https://github.com/s00500/nodeMessageBoard.git
synced 2025-07-04 01:00:19 +00:00
Database load working
This commit is contained in:
40
app.js
40
app.js
@ -9,43 +9,3 @@ handle["/"] = requestHandlers.sendInterface;
|
||||
handle["/interface"] = requestHandlers.sendInterface;
|
||||
|
||||
server.start(router.route,handle,debug);
|
||||
|
||||
|
||||
|
||||
|
||||
// old app.js
|
||||
/*
|
||||
console.log("hello world\r");
|
||||
var port = 3000;
|
||||
var express = require('express')
|
||||
var app = express()
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
res.send('Hello World')
|
||||
});
|
||||
|
||||
app.listen(port, function () {
|
||||
console.log('Example app listening on port '+port+'!');
|
||||
});
|
||||
|
||||
var serialport = require("serialport");
|
||||
var SerialPort = serialport.SerialPort;
|
||||
var serialPort = new SerialPort("/dev/tty.usbmodemFD121", {
|
||||
baudrate: 19200,
|
||||
parser: serialport.parsers.readline("\n")
|
||||
});
|
||||
|
||||
|
||||
serialPort.on("open", function () {
|
||||
console.log('open');
|
||||
serialPort.on("data", function (data) {
|
||||
console.log("here: "+data);
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
res.send(data)
|
||||
})
|
||||
});
|
||||
|
||||
serialPort.write("AT+CPIN?\r");
|
||||
});
|
||||
*/
|
||||
|
Reference in New Issue
Block a user