Env Vars & Geocode Data Caching
This commit is contained in:
5
index.js
5
index.js
@@ -5,6 +5,7 @@ const { getAllMusicFiles } = require('./src/musicPlaylist');
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3000;
|
||||
const WS4KP_PORT = process.env.WS4KP_PORT || 8080;
|
||||
const MUSIC_PATH = process.env.MUSIC_PATH || '/music';
|
||||
|
||||
/**
|
||||
@@ -37,7 +38,8 @@ function buildWeatherUrl(latitude, longitude, settings) {
|
||||
const pressureUnit = isMetric ? '1.00' : '2.00';
|
||||
const hoursFormat = timeFormat === '12h' ? '1.00' : '2.00';
|
||||
|
||||
const ws4kpBaseUrl = process.env.WS4KP_URL || 'http://localhost:8080';
|
||||
const ws4kpPort = process.env.WS4KP_PORT || 8080;
|
||||
const ws4kpBaseUrl = process.env.WS4KP_URL || `http://localhost:${ws4kpPort}`;
|
||||
|
||||
const ws4kpParams = new URLSearchParams({
|
||||
'hazards-checkbox': showHazards,
|
||||
@@ -187,6 +189,7 @@ app.get('/health', (req, res) => {
|
||||
// Start server
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Webpage to HLS server running on port ${PORT}`);
|
||||
console.log(`WS4KP weather service on port ${WS4KP_PORT}`);
|
||||
console.log(`Usage: http://localhost:${PORT}/stream?url=http://example.com`);
|
||||
console.log(`Weather: http://localhost:${PORT}/weather?city=YourCity`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user