Create GatewayServer class

This commit is contained in:
Starbeamrainbowlabs 2019-01-03 20:01:48 +00:00
parent dcfbd2f498
commit 6e4618af37
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
2 changed files with 22 additions and 4 deletions

17
GatewayServer.mjs Normal file
View File

@ -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;

View File

@ -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++) {
break;
}
}
const server = new GatewayServer(settings);
server.start();