mrmd-server 0.1.3 → 0.1.5
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 -2
- package/src/server.js +12 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mrmd-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "HTTP server for mrmd - run mrmd in any browser, access from anywhere",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"chokidar": "^3.6.0",
|
|
47
47
|
"fzf": "^0.5.2",
|
|
48
48
|
"mrmd-project": "^0.1.1",
|
|
49
|
-
"mrmd-electron": "^0.3.
|
|
49
|
+
"mrmd-electron": "^0.3.3",
|
|
50
50
|
"mrmd-sync": "^0.3.2"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/server.js
CHANGED
|
@@ -200,10 +200,18 @@ export async function createServer(config) {
|
|
|
200
200
|
// Serve mrmd-electron assets (fonts, icons)
|
|
201
201
|
app.use('/assets', express.static(path.join(electronPath, 'assets')));
|
|
202
202
|
|
|
203
|
-
// Serve mrmd-editor dist
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
// Serve mrmd-editor dist - check multiple locations
|
|
204
|
+
const editorDistCandidates = [
|
|
205
|
+
path.join(electronPath, 'editor'), // Bundled in mrmd-electron (npm)
|
|
206
|
+
path.join(electronPath, '../mrmd-editor/dist'), // Sibling (dev mode)
|
|
207
|
+
];
|
|
208
|
+
for (const distPath of editorDistCandidates) {
|
|
209
|
+
if (existsSync(path.join(distPath, 'mrmd.iife.js'))) {
|
|
210
|
+
app.use('/mrmd-editor/dist', express.static(distPath));
|
|
211
|
+
app.use('/dist', express.static(distPath));
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
207
215
|
|
|
208
216
|
// Serve node_modules from mrmd-electron (for xterm, etc.)
|
|
209
217
|
app.use('/node_modules', express.static(path.join(electronPath, 'node_modules')));
|