mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Ability to auto-discover sonos devices or find by using a seed ip
This commit is contained in:
22
src/server.ts
Normal file
22
src/server.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import express, { Express } from "express";
|
||||
import * as Eta from "eta";
|
||||
import { Sonos } from "./sonos";
|
||||
|
||||
function server(sonos: Sonos): Express {
|
||||
const app = express();
|
||||
app.use(express.static("./web/public"));
|
||||
|
||||
app.engine("eta", Eta.renderFile);
|
||||
app.set("view engine", "eta");
|
||||
app.set("views", "./web/views");
|
||||
|
||||
app.get("/", (_, res) => {
|
||||
res.render("index", {
|
||||
devices: sonos.devices(),
|
||||
});
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
export default server;
|
||||
Reference in New Issue
Block a user