mrmd-server 0.1.15 → 0.1.16
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 +1 -1
- package/src/api/file.js +6 -3
- package/src/server.js +7 -3
package/package.json
CHANGED
package/src/api/file.js
CHANGED
|
@@ -22,10 +22,13 @@ export function createFileRoutes(ctx) {
|
|
|
22
22
|
*/
|
|
23
23
|
router.get('/scan', async (req, res) => {
|
|
24
24
|
try {
|
|
25
|
-
|
|
25
|
+
// Default to home directory (like Electron's file picker)
|
|
26
|
+
const os = await import('os');
|
|
27
|
+
const root = req.query.root || ctx.projectDir || os.default.homedir();
|
|
26
28
|
const options = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
// Default to both .md and .ipynb (like Electron)
|
|
30
|
+
extensions: req.query.extensions?.split(',') || ['.md', '.ipynb'],
|
|
31
|
+
maxDepth: parseInt(req.query.maxDepth) || 10,
|
|
29
32
|
includeHidden: req.query.includeHidden === 'true',
|
|
30
33
|
};
|
|
31
34
|
|
package/src/server.js
CHANGED
|
@@ -324,9 +324,13 @@ export async function createServer(config) {
|
|
|
324
324
|
|
|
325
325
|
upstream.on('open', () => {
|
|
326
326
|
syncWss.handleUpgrade(request, socket, head, (clientWs) => {
|
|
327
|
-
// Bidirectional proxy
|
|
328
|
-
clientWs.on('message', (data) =>
|
|
329
|
-
|
|
327
|
+
// Bidirectional proxy - preserve message type (binary/text)
|
|
328
|
+
clientWs.on('message', (data, isBinary) => {
|
|
329
|
+
upstream.send(data, { binary: isBinary });
|
|
330
|
+
});
|
|
331
|
+
upstream.on('message', (data, isBinary) => {
|
|
332
|
+
clientWs.send(data, { binary: isBinary });
|
|
333
|
+
});
|
|
330
334
|
clientWs.on('close', () => upstream.close());
|
|
331
335
|
upstream.on('close', () => clientWs.close());
|
|
332
336
|
clientWs.on('error', () => upstream.close());
|