ability to specify sonos service name and id

This commit is contained in:
simojenki
2021-01-31 10:08:31 +11:00
parent ad09a88de8
commit 1e8820b419
7 changed files with 59 additions and 38 deletions

View File

@@ -1,12 +1,20 @@
import sonos from "./sonos";
import sonos, { bonobService } from "./sonos";
import server from "./server";
import logger from "./logger"
const PORT = process.env["PORT"] || 4534;
const app = server(sonos(process.env["BONOB_SONOS_SEED_HOST"]));
const bonob = bonobService(
process.env["BONOB_SONOS_SERVICE_NAME"] || "bonob",
Number(process.env["BONOS_SONOS_SERVICE_ID"] || "246")
)
const app = server(
sonos(process.env["BONOB_SONOS_SEED_HOST"]),
bonob
);
app.listen(PORT, () => {
console.info(`Listening on ${PORT}`);
logger.info(`Listening on ${PORT}`);
});
export default app;