From 6d6806218134b0e8499bbbad4d773447ec2a89b9 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 1 Aug 2018 14:44:46 +0200 Subject: [PATCH] initial --- .gitignore | 35 +++++++++++++++++++++++++++++++++++ mqttToInflux.service | 18 ++++++++++++++++++ package.json | 31 +++++++++++++++++++++++++++++++ tsconfig.json | 23 +++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 .gitignore create mode 100644 mqttToInflux.service create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce200cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp + +# dependencies +/node_modules +/bower_components + +# IDEs and editors +/.idea +/.vscode +.project +.classpath +.c9/ +*.launch +.settings/ + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +#System Files +.DS_Store +Thumbs.db diff --git a/mqttToInflux.service b/mqttToInflux.service new file mode 100644 index 0000000..b8fb08b --- /dev/null +++ b/mqttToInflux.service @@ -0,0 +1,18 @@ +[Unit] +Description=mqttToInflux +Wants=network-online.target +After=network-online.target + + +[Service] +Type=simple +GuessMainPID=yes +ExecStart=/usr/bin/npm start -- -c MqttToInflux-Prod.conf +ExecStop=kill -SIGINT $mainpid +Restart=on-failure +WorkingDirectory=/opt/services/MqttToInflux + +[Install] +Alias=mqttToInflux +WantedBy=multi-user.target + diff --git a/package.json b/package.json new file mode 100644 index 0000000..f7b7ac0 --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "mqtt_to_influx", + "version": "1.0.0", + "description": "MQTT to InfluxDB Gateway", + "main": "dist/main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc -p ./", + "start": "node dist/main.js" + }, + "author": "Wolfgang Hottgenroth", + "license": "ISC", + "repository": { + "type": "git", + "url": "git@gitlab.com:wolutator/MqttToInflux.git" + }, + "devDependencies": { + "@types/command-line-args": "^5.0.0", + "@types/moment": "^2.13.0", + "@types/mqtt": "0.0.34", + "@types/node": "^7.0.14", + "typescript": "^2.3.1" + }, + "dependencies": { + "chalk-console": "^1.0.1", + "command-line-args": "^5.0.2", + "commander": "^2.15.1", + "moment": "^2.22.1", + "mqtt": "^2.6.2" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..5df1fbd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "lib": ["es2015"], + "strictNullChecks": true, + "noImplicitAny": true, + "noEmitOnError": true, + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] + }, + "include": [ + "src/**/*.*" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file