Skip to content

Commit

Permalink
Fix #121
Browse files Browse the repository at this point in the history
Show SwaggerUI url in logs
  • Loading branch information
haimkastner committed Sep 5, 2024
1 parent 17ef6a2 commit a5a9128
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { exec } from 'child-process-promise';
import * as fs from 'fs';
import * as http from 'http';
import * as https from 'https';
import * as ip from 'ip';
import { Configuration } from './config';
import { logger } from './utilities/logger';
import { app } from './app';
Expand Down Expand Up @@ -66,6 +67,7 @@ async function initServices() {
logger.info(`[home-iot-server] ------------------- Initializing HTTP server... -------------------`);
http.createServer(app).listen(Configuration.http.httpPort, () => {
logger.info(`[home-iot-server] ------------------- Initializing HTTP server on port ${Configuration.http.httpPort} succeed -------------------`);
logger.info(`[home-iot-server] ------------------- Swagger UI http:${ip.address()}:${Configuration.http.httpPort}/docs -------------------`);
});

// SSL/HTTPS
Expand All @@ -84,6 +86,7 @@ async function initServices() {

https.createServer(sslOptions, app).listen(Configuration.http.httpsPort, () => {
logger.info(`[home-iot-server] ------------------- Initializing HTTPS server on port ${Configuration.http.httpPort} succeed -------------------`);
logger.info(`[home-iot-server] ------------------- Swagger UI https:${ip.address()}:${Configuration.http.httpPort}/docs -------------------`);
});
} catch (error) {
logger.error(`Failed to load SSL certificate ${error}, exit...`);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/modules/mqtt/mqtt-drivers/casanetMqttDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CasanetMqttDriver extends MqttBaseDriver {

public async convertMqttMessage(topic: string, data: string): Promise<ParsedMqttMessage> {
const topics = topic.split('/');
const minionId = topics[1];
const minionId = topics[2];

const minions = await this.retrieveMinions.pull();

Expand Down

0 comments on commit a5a9128

Please sign in to comment.