2
0
mirror of https://github.com/ad1217/PrinterStatus synced 2024-11-21 15:03:48 -05:00

Add a port environment variable

This commit is contained in:
Adam Goldsmith 2020-02-19 20:43:27 -05:00
parent ebc24fdfc2
commit 69efcd94da

View File

@ -13,6 +13,8 @@ import * as expressWs from 'express-ws';
import * as messages from './messages'; import * as messages from './messages';
import * as octoprint from './octoprint'; import * as octoprint from './octoprint';
const PORT = process.env.PORT || 1234;
// Load config // Load config
const config: { const config: {
printers: { address: string; apikey: string }[]; printers: { address: string; apikey: string }[];
@ -57,7 +59,7 @@ app.get('/webcam/:printer', (req, res) => {
let bundler = new Bundler(path.join(__dirname, 'index.html')); let bundler = new Bundler(path.join(__dirname, 'index.html'));
app.use(bundler.middleware()); app.use(bundler.middleware());
app.listen(1234); app.listen(PORT);
class PrinterStatus { class PrinterStatus {
address: string; address: string;