2
0
mirror of https://github.com/ad1217/PrinterStatus synced 2024-11-10 18:45:08 -05:00

Bump dependencies, explicitly type yaml config

This commit is contained in:
Adam Goldsmith 2020-09-09 16:47:04 -04:00
parent 4cc5ceeb52
commit 746e3fcd7e
3 changed files with 1257 additions and 1907 deletions

3121
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,32 @@
{
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@types/express": "^4.17.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@types/express": "^4.17.8",
"@types/express-ws": "^3.0.0",
"@types/http-proxy": "^1.17.4",
"@types/js-yaml": "^3.12.3",
"@types/node": "^13.13.4",
"@types/js-yaml": "^3.12.5",
"@types/node": "^14.6.4",
"@types/node-fetch": "^2.5.7",
"@types/parcel-bundler": "^1.12.1",
"@types/ws": "^7.2.4",
"@vue/component-compiler-utils": "^3.1.2",
"sass": "^1.26.5",
"typescript": "^3.8.3",
"vue-template-compiler": "^2.6.11"
"@types/ws": "^7.2.6",
"@vue/component-compiler-utils": "^3.2.0",
"sass": "^1.26.10",
"typescript": "^4.0.2",
"vue-template-compiler": "^2.6.12"
},
"dependencies": {
"express": "^4.17.1",
"express-ws": "^4.0.0",
"http-proxy": "^1.18.0",
"js-yaml": "^3.13.1",
"node-fetch": "^2.6.0",
"node-gyp": "^6.1.0",
"http-proxy": "^1.18.1",
"js-yaml": "^3.14.0",
"node-fetch": "^2.6.1",
"node-gyp": "^7.1.0",
"parcel-bundler": "^1.12.4",
"vue": "^2.6.11",
"vue": "^2.6.12",
"vue-class-component": "^7.2.5",
"vue-hot-reload-api": "^2.3.3",
"vue-property-decorator": "^8.4.2",
"ws": "^7.2.5"
"vue-property-decorator": "^9.0.0",
"ws": "^7.3.1"
},
"scripts": {
"build": "tsc src/server.ts",

View File

@ -15,10 +15,12 @@ import * as octoprint from './octoprint';
const PORT = process.env.PORT || 1234;
type configuration = { printers: { address: string; apikey: string }[] };
// Load config
const config: {
printers: { address: string; apikey: string }[];
} = yaml.safeLoad(fs.readFileSync('config.yaml', 'utf8'));
const config: configuration = yaml.safeLoad(
fs.readFileSync('config.yaml', 'utf8')
) as configuration;
const proxy = httpProxy.createProxyServer({});
proxy.on('error', function (e) {