mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
add com.chrome.devtools.json
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
import playlist from './src/playlist.mjs';
|
import playlist from './src/playlist.mjs';
|
||||||
import OVERRIDES from './src/overrides.mjs';
|
import OVERRIDES from './src/overrides.mjs';
|
||||||
import cache from './proxy/cache.mjs';
|
import cache from './proxy/cache.mjs';
|
||||||
|
import devTools from './src/com.chrome.devtools.mjs';
|
||||||
|
|
||||||
const travelCities = JSON.parse(await readFile('./datagenerators/output/travelcities.json'));
|
const travelCities = JSON.parse(await readFile('./datagenerators/output/travelcities.json'));
|
||||||
const regionalCities = JSON.parse(await readFile('./datagenerators/output/regionalcities.json'));
|
const regionalCities = JSON.parse(await readFile('./datagenerators/output/regionalcities.json'));
|
||||||
@@ -168,6 +169,7 @@ if (process.env?.DIST === '1') {
|
|||||||
app.use('/geoip', geoip);
|
app.use('/geoip', geoip);
|
||||||
app.use('/resources', express.static('./server/scripts/modules'));
|
app.use('/resources', express.static('./server/scripts/modules'));
|
||||||
app.get('/', index);
|
app.get('/', index);
|
||||||
|
app.get('/.well-known/appspecific/com.chrome.devtools.json', devTools);
|
||||||
app.get('*name', express.static('./server', staticOptions));
|
app.get('*name', express.static('./server', staticOptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
25
src/com.chrome.devtools.mjs
Normal file
25
src/com.chrome.devtools.mjs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import path from 'path';
|
||||||
|
|
||||||
|
// get values for devtools json
|
||||||
|
const uuid = 'd2bd1130-560f-4c8e-b2c5-e91073784964';
|
||||||
|
const root = path.resolve('server');
|
||||||
|
|
||||||
|
const DEVTOOLS_CONFIG = {
|
||||||
|
workspace: {
|
||||||
|
uuid,
|
||||||
|
root,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const devTools = (req, res) => {
|
||||||
|
// test for localhost
|
||||||
|
if (['127.0.0.1', '::1', '::ffff:127.0.0.1'].includes(req.ip)) {
|
||||||
|
console.log(DEVTOOLS_CONFIG);
|
||||||
|
res.json(DEVTOOLS_CONFIG);
|
||||||
|
} else {
|
||||||
|
// not localhost
|
||||||
|
res.status(404).send('File not found');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default devTools;
|
||||||
Reference in New Issue
Block a user