Browse Source

Create GatewayServer class

master
Starbeamrainbowlabs 3 years ago
parent
commit
6e4618af37
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 17
      GatewayServer.mjs
  2. 9
      gateway.js

17
GatewayServer.mjs

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
"use strict";
import Constants from './constants.mjs';
import Spi from 'spi';
import Gpio from 'gpio';
class GatewayServer {
constructor(in_settings) {
this.settings = in_settings;
}
start() {
}
}
export default GatewayServer;

9
gateway.js

@ -1,15 +1,13 @@ @@ -1,15 +1,13 @@
#!/usr/bin/env node
import Constants from './constants.mjs';
import Spi from 'spi';
import Gpio from 'gpio';
import GatewayServer from './GatewayServer.mjs';
const settings = {
spi_device: "/dev/spidev0.0"
};
// Skip the first 2 items - they are node file.js
let extras = [];
const extras = [];
for(let i = 2; i < process.argv.length; i++) {
if(!process.argv[i].startsWith("-")) {
extras.push(process.argv[i]);
@ -37,3 +35,6 @@ for(let i = 2; i < process.argv.length; i++) { @@ -37,3 +35,6 @@ for(let i = 2; i < process.argv.length; i++) {
break;
}
}
const server = new GatewayServer(settings);
server.start();