ambient-display 1.1.17 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/server/index.js +8 -1
- package/server/spotify/index.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ambient-display",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"description": "Like a spotify jam but much worse, but also much better. If you need it, you'll love it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"detect-rpi": "^1.5.0",
|
|
62
62
|
"dotenv": "^16.4.7",
|
|
63
63
|
"express": "^4.21.1",
|
|
64
|
+
"express-list-endpoints": "^7.1.1",
|
|
64
65
|
"node-fetch": "^3.3.2",
|
|
65
66
|
"node-vibrant": "3.1.6",
|
|
66
67
|
"normalize.css": "^8.0.1",
|
package/server/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import express from 'express';
|
|
|
4
4
|
import cors from 'cors';
|
|
5
5
|
import { createServer } from 'node:http';
|
|
6
6
|
import { Server } from 'socket.io';
|
|
7
|
+
import listEndpoints from 'express-list-endpoints';
|
|
7
8
|
|
|
8
9
|
import { ERROR, EVENT } from './constants.js';
|
|
9
10
|
import * as Types from './types/options.js';
|
|
@@ -114,7 +115,7 @@ const sdkProtect = (req, res, next) => {
|
|
|
114
115
|
|
|
115
116
|
// Mount the spotify sub app
|
|
116
117
|
const spotify = await SpotifyRoutes(sdk, OPTIONS);
|
|
117
|
-
app.use(
|
|
118
|
+
app.use(OPTIONS.spotify.routePrefix, spotify);
|
|
118
119
|
|
|
119
120
|
// Mount the api sub app
|
|
120
121
|
app.use('/api', sdkProtect, ApiRoutes(io, sdk, OPTIONS.api ?? {}));
|
|
@@ -155,6 +156,12 @@ export default {
|
|
|
155
156
|
inject,
|
|
156
157
|
server,
|
|
157
158
|
start() {
|
|
159
|
+
if (OPTIONS.verbose) {
|
|
160
|
+
const endpoints = listEndpoints(app);
|
|
161
|
+
|
|
162
|
+
console.log(endpoints);
|
|
163
|
+
}
|
|
164
|
+
|
|
158
165
|
server.listen(OPTIONS.port, () => {
|
|
159
166
|
console.log(`App running on port ${URL}`);
|
|
160
167
|
events.system('start');
|
package/server/spotify/index.js
CHANGED
|
@@ -22,6 +22,10 @@ const run = async (sdk, options) => {
|
|
|
22
22
|
// First check if there is previous auth that is valid
|
|
23
23
|
const refreshedAuth = await initialisePreviousAuth(options.spotify);
|
|
24
24
|
|
|
25
|
+
if (options.verbose) {
|
|
26
|
+
console.log('Result of refreshed auth', refreshedAuth);
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
// If there is, initialise it while also persisting the auth
|
|
26
30
|
if (refreshedAuth) {
|
|
27
31
|
await persistSdk(refreshedAuth, options);
|