honox 0.1.2 → 0.1.4
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/README.md +53 -1
- package/dist/client/runtime.js +12 -10
- package/dist/server/server.d.ts +4 -0
- package/dist/server/server.js +35 -22
- package/package.json +3 -3
- package/dist/server/factory/factory.d.ts +0 -19
- package/dist/server/factory/factory.js +0 -11
- package/dist/server/factory/index.d.ts +0 -3
- package/dist/server/factory/index.js +0 -5
- package/dist/vite/watch-reload.d.ts +0 -5
- package/dist/vite/watch-reload.js +0 -17
package/README.md
CHANGED
|
@@ -466,6 +466,25 @@ export const POST = createRoute(zValidator('form', schema), async (c) => {
|
|
|
466
466
|
})
|
|
467
467
|
```
|
|
468
468
|
|
|
469
|
+
Alternatively, you can use a `_middleware.(ts|tsx)` file in a directory to have that middleware applied to the current route, as well as all child routes. Middleware is ran in the order that it is listed within the array.
|
|
470
|
+
|
|
471
|
+
An equivilant example to the previous Hono-style middleware configuration is as follows:
|
|
472
|
+
|
|
473
|
+
```tsx
|
|
474
|
+
// /app/_middleware.ts
|
|
475
|
+
import { createRoute } from 'honox/factory'
|
|
476
|
+
import { z } from 'zod'
|
|
477
|
+
import { zValidator } from '@hono/zod-validator'
|
|
478
|
+
|
|
479
|
+
const schema = z.object({
|
|
480
|
+
name: z.string().max(10),
|
|
481
|
+
})
|
|
482
|
+
|
|
483
|
+
export default createRoute(zValidator('form', schema), ...<more-middleware>)
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
Note that is some scenarios, auto-complete for the request body within the route may be lost depending on how the middleware was written.
|
|
487
|
+
|
|
469
488
|
### Using Tailwind CSS
|
|
470
489
|
|
|
471
490
|
Given that HonoX is Vite-centric, if you wish to utilize [Tailwind CSS](https://tailwindcss.com/), simply adhere to the official instructions.
|
|
@@ -648,11 +667,44 @@ const entry = './app/server.ts'
|
|
|
648
667
|
|
|
649
668
|
export default defineConfig(() => {
|
|
650
669
|
return {
|
|
651
|
-
plugins: [honox(),
|
|
670
|
+
plugins: [honox(), ssg({ entry })],
|
|
652
671
|
}
|
|
653
672
|
})
|
|
654
673
|
```
|
|
655
674
|
|
|
675
|
+
If you want to include client side scripts and assets:
|
|
676
|
+
|
|
677
|
+
```ts
|
|
678
|
+
// vite.config.ts
|
|
679
|
+
import ssg from '@hono/vite-ssg'
|
|
680
|
+
import honox from 'honox/vite'
|
|
681
|
+
import client from 'honox/vite/client'
|
|
682
|
+
import { defineConfig } from 'vite'
|
|
683
|
+
|
|
684
|
+
const entry = './app/server.ts'
|
|
685
|
+
|
|
686
|
+
export default defineConfig(({ mode }) => {
|
|
687
|
+
if (mode === 'client') {
|
|
688
|
+
return {
|
|
689
|
+
plugins: [client()],
|
|
690
|
+
}
|
|
691
|
+
} else {
|
|
692
|
+
return {
|
|
693
|
+
build: {
|
|
694
|
+
emptyOutDir: false,
|
|
695
|
+
},
|
|
696
|
+
plugins: [honox(), ssg({ entry })],
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
})
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
Build command (including a client):
|
|
703
|
+
|
|
704
|
+
```txt
|
|
705
|
+
vite build --mode client && vite build
|
|
706
|
+
```
|
|
707
|
+
|
|
656
708
|
You can also deploy it to Cloudflare Pages.
|
|
657
709
|
|
|
658
710
|
```txt
|
package/dist/client/runtime.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Suspense, use } from "hono/jsx/dom";
|
|
2
2
|
const buildCreateChildrenFn = (createElement) => {
|
|
3
|
+
const createElementFromHTMLElement = async (element) => {
|
|
4
|
+
const props = {
|
|
5
|
+
children: await createChildren(element.childNodes)
|
|
6
|
+
};
|
|
7
|
+
const attributes = element.attributes;
|
|
8
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
9
|
+
props[attributes[i].name] = attributes[i].value;
|
|
10
|
+
}
|
|
11
|
+
return createElement(element.nodeName, props);
|
|
12
|
+
};
|
|
3
13
|
const createChildren = async (childNodes) => {
|
|
4
14
|
const children = [];
|
|
5
15
|
for (let i = 0; i < childNodes.length; i++) {
|
|
@@ -32,11 +42,7 @@ const buildCreateChildrenFn = (createElement) => {
|
|
|
32
42
|
} else if (child2.nodeType === 3) {
|
|
33
43
|
fallback.push(child2.textContent);
|
|
34
44
|
} else {
|
|
35
|
-
fallback.push(
|
|
36
|
-
await createElement(child2.nodeName, {
|
|
37
|
-
children: await createChildren(child2.childNodes)
|
|
38
|
-
})
|
|
39
|
-
);
|
|
45
|
+
fallback.push(await createElementFromHTMLElement(child2));
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
const fallbackTemplates = document.querySelectorAll(
|
|
@@ -65,11 +71,7 @@ const buildCreateChildrenFn = (createElement) => {
|
|
|
65
71
|
})
|
|
66
72
|
);
|
|
67
73
|
} else {
|
|
68
|
-
children.push(
|
|
69
|
-
await createElement(child.nodeName, {
|
|
70
|
-
children: await createChildren(child.childNodes)
|
|
71
|
-
})
|
|
72
|
-
);
|
|
74
|
+
children.push(await createElementFromHTMLElement(child));
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
return children;
|
package/dist/server/server.d.ts
CHANGED
|
@@ -21,12 +21,16 @@ type NotFoundFile = {
|
|
|
21
21
|
type ErrorFile = {
|
|
22
22
|
default: ErrorHandler;
|
|
23
23
|
};
|
|
24
|
+
type MiddlewareFile = {
|
|
25
|
+
default: MiddlewareHandler[];
|
|
26
|
+
};
|
|
24
27
|
type InitFunction<E extends Env = Env> = (app: Hono<E>) => void;
|
|
25
28
|
type ServerOptions<E extends Env = Env> = {
|
|
26
29
|
ROUTES?: Record<string, RouteFile>;
|
|
27
30
|
RENDERER?: Record<string, RendererFile>;
|
|
28
31
|
NOT_FOUND?: Record<string, NotFoundFile>;
|
|
29
32
|
ERROR?: Record<string, ErrorFile>;
|
|
33
|
+
MIDDLEWARE?: Record<string, MiddlewareFile>;
|
|
30
34
|
root?: string;
|
|
31
35
|
app?: Hono<E>;
|
|
32
36
|
init?: InitFunction<E>;
|
package/dist/server/server.js
CHANGED
|
@@ -29,36 +29,49 @@ const createApp = (options) => {
|
|
|
29
29
|
eager: true
|
|
30
30
|
});
|
|
31
31
|
const rendererList = listByDirectory(RENDERER_FILE);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
app2.all("*", rendererDefault);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
32
|
+
const MIDDLEWARE_FILE = options?.MIDDLEWARE ?? import.meta.glob("/app/routes/**/_middleware.(ts|tsx)", {
|
|
33
|
+
eager: true
|
|
34
|
+
});
|
|
35
|
+
const middlewareList = listByDirectory(MIDDLEWARE_FILE);
|
|
39
36
|
const ROUTES_FILE = options?.ROUTES ?? import.meta.glob("/app/routes/**/[!_]*.(ts|tsx|mdx)", {
|
|
40
37
|
eager: true
|
|
41
38
|
});
|
|
42
39
|
const routesMap = sortDirectoriesByDepth(groupByDirectory(ROUTES_FILE));
|
|
40
|
+
const getPaths = (currentDirectory, fileList) => {
|
|
41
|
+
let paths = fileList[currentDirectory] ?? [];
|
|
42
|
+
const getChildPaths = (childDirectories) => {
|
|
43
|
+
paths = fileList[childDirectories.join("/")];
|
|
44
|
+
if (!paths) {
|
|
45
|
+
childDirectories.pop();
|
|
46
|
+
if (childDirectories.length) {
|
|
47
|
+
getChildPaths(childDirectories);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return paths ?? [];
|
|
51
|
+
};
|
|
52
|
+
const renderDirPaths = currentDirectory.split("/");
|
|
53
|
+
paths = getChildPaths(renderDirPaths);
|
|
54
|
+
paths.sort((a, b) => a.split("/").length - b.split("/").length);
|
|
55
|
+
return paths;
|
|
56
|
+
};
|
|
43
57
|
for (const map of routesMap) {
|
|
44
58
|
for (const [dir, content] of Object.entries(map)) {
|
|
45
59
|
const subApp = new Hono();
|
|
46
|
-
|
|
47
|
-
const getRendererPaths = (paths) => {
|
|
48
|
-
rendererPaths = rendererList[paths.join("/")];
|
|
49
|
-
if (!rendererPaths) {
|
|
50
|
-
paths.pop();
|
|
51
|
-
if (paths.length) {
|
|
52
|
-
getRendererPaths(paths);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return rendererPaths ?? [];
|
|
56
|
-
};
|
|
57
|
-
const dirPaths = dir.split("/");
|
|
58
|
-
rendererPaths = getRendererPaths(dirPaths);
|
|
59
|
-
rendererPaths.sort((a, b) => a.split("/").length - b.split("/").length);
|
|
60
|
+
const rendererPaths = getPaths(dir, rendererList);
|
|
60
61
|
rendererPaths.map((path) => {
|
|
61
|
-
|
|
62
|
+
const renderer = RENDERER_FILE[path];
|
|
63
|
+
const rendererDefault = renderer.default;
|
|
64
|
+
if (rendererDefault) {
|
|
65
|
+
subApp.all("*", rendererDefault);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const middlewarePaths = getPaths(dir, middlewareList);
|
|
69
|
+
middlewarePaths.map((path) => {
|
|
70
|
+
const middleware = MIDDLEWARE_FILE[path];
|
|
71
|
+
const middlewareDefault = middleware.default;
|
|
72
|
+
if (middlewareDefault) {
|
|
73
|
+
subApp.use(...middlewareDefault);
|
|
74
|
+
}
|
|
62
75
|
});
|
|
63
76
|
let rootPath = dir.replace(rootRegExp, "");
|
|
64
77
|
rootPath = filePathToPath(rootPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "honox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@babel/parser": "^7.23.6",
|
|
100
100
|
"@babel/traverse": "^7.23.6",
|
|
101
101
|
"@babel/types": "^7.23.6",
|
|
102
|
-
"@hono/vite-dev-server": "^0.
|
|
102
|
+
"@hono/vite-dev-server": "^0.7.0"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
105
|
"hono": ">=4.*"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@types/node": "^20.10.5",
|
|
114
114
|
"eslint": "^8.56.0",
|
|
115
115
|
"glob": "^10.3.10",
|
|
116
|
-
"hono": "^4.0.
|
|
116
|
+
"hono": "^4.0.5",
|
|
117
117
|
"np": "7.7.0",
|
|
118
118
|
"prettier": "^3.1.1",
|
|
119
119
|
"publint": "^0.2.7",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as hono_types from 'hono/types';
|
|
2
|
-
import * as hono from 'hono';
|
|
3
|
-
import { Env, Hono } from 'hono';
|
|
4
|
-
|
|
5
|
-
declare const createRoute: {
|
|
6
|
-
<I extends hono.Input = {}>(handler1: hono_types.H<Env, any, I>): [hono_types.H<Env, any, I>];
|
|
7
|
-
<I_1 extends hono.Input = {}, I2 extends hono.Input = I_1, R extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_1, R>, handler2: hono_types.H<Env, any, I2, R>): [hono_types.H<Env, any, I_1, R>, hono_types.H<Env, any, I2, R>];
|
|
8
|
-
<I_2 extends hono.Input = {}, I2_1 extends hono.Input = I_2, I3 extends hono.Input = I_2 & I2_1, R_1 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_2, R_1>, handler2: hono_types.H<Env, any, I2_1, R_1>, handler3: hono_types.H<Env, any, I3, R_1>): [hono_types.H<Env, any, I_2, R_1>, hono_types.H<Env, any, I2_1, R_1>, hono_types.H<Env, any, I3, R_1>];
|
|
9
|
-
<I_3 extends hono.Input = {}, I2_2 extends hono.Input = I_3, I3_1 extends hono.Input = I_3 & I2_2, I4 extends hono.Input = I_3 & I2_2 & I3_1, R_2 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_3, R_2>, handler2: hono_types.H<Env, any, I2_2, R_2>, handler3: hono_types.H<Env, any, I3_1, R_2>, handler4: hono_types.H<Env, any, I4, R_2>): [hono_types.H<Env, any, I_3, R_2>, hono_types.H<Env, any, I2_2, R_2>, hono_types.H<Env, any, I3_1, R_2>, hono_types.H<Env, any, I4, R_2>];
|
|
10
|
-
<I_4 extends hono.Input = {}, I2_3 extends hono.Input = I_4, I3_2 extends hono.Input = I_4 & I2_3, I4_1 extends hono.Input = I_4 & I2_3 & I3_2, I5 extends hono.Input = I_4 & I2_3 & I3_2 & I4_1, R_3 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_4, R_3>, handler2: hono_types.H<Env, any, I2_3, R_3>, handler3: hono_types.H<Env, any, I3_2, R_3>, handler4: hono_types.H<Env, any, I4_1, R_3>, handler5: hono_types.H<Env, any, I5, R_3>): [hono_types.H<Env, any, I_4, R_3>, hono_types.H<Env, any, I2_3, R_3>, hono_types.H<Env, any, I3_2, R_3>, hono_types.H<Env, any, I4_1, R_3>, hono_types.H<Env, any, I5, R_3>];
|
|
11
|
-
<I_5 extends hono.Input = {}, I2_4 extends hono.Input = I_5, I3_3 extends hono.Input = I_5 & I2_4, I4_2 extends hono.Input = I_5 & I2_4 & I3_3, I5_1 extends hono.Input = I_5 & I2_4 & I3_3 & I4_2, I6 extends hono.Input = I_5 & I2_4 & I3_3 & I4_2 & I5_1, R_4 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_5, R_4>, handler2: hono_types.H<Env, any, I2_4, R_4>, handler3: hono_types.H<Env, any, I3_3, R_4>, handler4: hono_types.H<Env, any, I4_2, R_4>, handler5: hono_types.H<Env, any, I5_1, R_4>, handler6: hono_types.H<Env, any, I6, R_4>): [hono_types.H<Env, any, I_5, R_4>, hono_types.H<Env, any, I2_4, R_4>, hono_types.H<Env, any, I3_3, R_4>, hono_types.H<Env, any, I4_2, R_4>, hono_types.H<Env, any, I5_1, R_4>, hono_types.H<Env, any, I6, R_4>];
|
|
12
|
-
<I_6 extends hono.Input = {}, I2_5 extends hono.Input = I_6, I3_4 extends hono.Input = I_6 & I2_5, I4_3 extends hono.Input = I_6 & I2_5 & I3_4, I5_2 extends hono.Input = I_6 & I2_5 & I3_4 & I4_3, I6_1 extends hono.Input = I_6 & I2_5 & I3_4 & I4_3 & I5_2, I7 extends hono.Input = I_6 & I2_5 & I3_4 & I4_3 & I5_2 & I6_1, R_5 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_6, R_5>, handler2: hono_types.H<Env, any, I2_5, R_5>, handler3: hono_types.H<Env, any, I3_4, R_5>, handler4: hono_types.H<Env, any, I4_3, R_5>, handler5: hono_types.H<Env, any, I5_2, R_5>, handler6: hono_types.H<Env, any, I6_1, R_5>, handler7: hono_types.H<Env, any, I7, R_5>): [hono_types.H<Env, any, I_6, R_5>, hono_types.H<Env, any, I2_5, R_5>, hono_types.H<Env, any, I3_4, R_5>, hono_types.H<Env, any, I4_3, R_5>, hono_types.H<Env, any, I5_2, R_5>, hono_types.H<Env, any, I6_1, R_5>, hono_types.H<Env, any, I7, R_5>];
|
|
13
|
-
<I_7 extends hono.Input = {}, I2_6 extends hono.Input = I_7, I3_5 extends hono.Input = I_7 & I2_6, I4_4 extends hono.Input = I_7 & I2_6 & I3_5, I5_3 extends hono.Input = I_7 & I2_6 & I3_5 & I4_4, I6_2 extends hono.Input = I_7 & I2_6 & I3_5 & I4_4 & I5_3, I7_1 extends hono.Input = I_7 & I2_6 & I3_5 & I4_4 & I5_3 & I6_2, I8 extends hono.Input = I_7 & I2_6 & I3_5 & I4_4 & I5_3 & I6_2 & I7_1, R_6 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_7, R_6>, handler2: hono_types.H<Env, any, I2_6, R_6>, handler3: hono_types.H<Env, any, I3_5, R_6>, handler4: hono_types.H<Env, any, I4_4, R_6>, handler5: hono_types.H<Env, any, I5_3, R_6>, handler6: hono_types.H<Env, any, I6_2, R_6>, handler7: hono_types.H<Env, any, I7_1, R_6>, handler8: hono_types.H<Env, any, I8, R_6>): [hono_types.H<Env, any, I_7, R_6>, hono_types.H<Env, any, I2_6, R_6>, hono_types.H<Env, any, I3_5, R_6>, hono_types.H<Env, any, I4_4, R_6>, hono_types.H<Env, any, I5_3, R_6>, hono_types.H<Env, any, I6_2, R_6>, hono_types.H<Env, any, I7_1, R_6>, hono_types.H<Env, any, I8, R_6>];
|
|
14
|
-
<I_8 extends hono.Input = {}, I2_7 extends hono.Input = I_8, I3_6 extends hono.Input = I_8 & I2_7, I4_5 extends hono.Input = I_8 & I2_7 & I3_6, I5_4 extends hono.Input = I_8 & I2_7 & I3_6 & I4_5, I6_3 extends hono.Input = I_8 & I2_7 & I3_6 & I4_5 & I5_4, I7_2 extends hono.Input = I_8 & I2_7 & I3_6 & I4_5 & I5_4 & I6_3, I8_1 extends hono.Input = I_8 & I2_7 & I3_6 & I4_5 & I5_4 & I6_3 & I7_2, I9 extends hono.Input = I_8 & I2_7 & I3_6 & I4_5 & I5_4 & I6_3 & I7_2 & I8_1, R_7 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_8, R_7>, handler2: hono_types.H<Env, any, I2_7, R_7>, handler3: hono_types.H<Env, any, I3_6, R_7>, handler4: hono_types.H<Env, any, I4_5, R_7>, handler5: hono_types.H<Env, any, I5_4, R_7>, handler6: hono_types.H<Env, any, I6_3, R_7>, handler7: hono_types.H<Env, any, I7_2, R_7>, handler8: hono_types.H<Env, any, I8_1, R_7>, handler9: hono_types.H<Env, any, I9, R_7>): [hono_types.H<Env, any, I_8, R_7>, hono_types.H<Env, any, I2_7, R_7>, hono_types.H<Env, any, I3_6, R_7>, hono_types.H<Env, any, I4_5, R_7>, hono_types.H<Env, any, I5_4, R_7>, hono_types.H<Env, any, I6_3, R_7>, hono_types.H<Env, any, I7_2, R_7>, hono_types.H<Env, any, I8_1, R_7>, hono_types.H<Env, any, I9, R_7>];
|
|
15
|
-
<I_9 extends hono.Input = {}, I2_8 extends hono.Input = I_9, I3_7 extends hono.Input = I_9 & I2_8, I4_6 extends hono.Input = I_9 & I2_8 & I3_7, I5_5 extends hono.Input = I_9 & I2_8 & I3_7 & I4_6, I6_4 extends hono.Input = I_9 & I2_8 & I3_7 & I4_6 & I5_5, I7_3 extends hono.Input = I_9 & I2_8 & I3_7 & I4_6 & I5_5 & I6_4, I8_2 extends hono.Input = I_9 & I2_8 & I3_7 & I4_6 & I5_5 & I6_4 & I7_3, I9_1 extends hono.Input = I_9 & I2_8 & I3_7 & I4_6 & I5_5 & I6_4 & I7_3 & I8_2, I10 extends hono.Input = I_9 & I2_8 & I3_7 & I4_6 & I5_5 & I6_4 & I7_3 & I8_2 & I9_1, R_8 extends hono_types.HandlerResponse<any> = any>(handler1: hono_types.H<Env, any, I_9, R_8>, handler2: hono_types.H<Env, any, I2_8, R_8>, handler3: hono_types.H<Env, any, I3_7, R_8>, handler4: hono_types.H<Env, any, I4_6, R_8>, handler5: hono_types.H<Env, any, I5_5, R_8>, handler6: hono_types.H<Env, any, I6_4, R_8>, handler7: hono_types.H<Env, any, I7_3, R_8>, handler8: hono_types.H<Env, any, I8_2, R_8>, handler9: hono_types.H<Env, any, I9_1, R_8>, handler10: hono_types.H<Env, any, I10, R_8>): [hono_types.H<Env, any, I_9, R_8>, hono_types.H<Env, any, I2_8, R_8>, hono_types.H<Env, any, I3_7, R_8>, hono_types.H<Env, any, I4_6, R_8>, hono_types.H<Env, any, I5_5, R_8>, hono_types.H<Env, any, I6_4, R_8>, hono_types.H<Env, any, I7_3, R_8>, hono_types.H<Env, any, I8_2, R_8>, hono_types.H<Env, any, I9_1, R_8>, hono_types.H<Env, any, I10, R_8>];
|
|
16
|
-
};
|
|
17
|
-
declare const createHono: () => Hono<Env, hono_types.BlankSchema, "/">;
|
|
18
|
-
|
|
19
|
-
export { createHono, createRoute };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function restartOnAddUnlink() {
|
|
2
|
-
return {
|
|
3
|
-
name: "restart-on-add-unlink",
|
|
4
|
-
configureServer(server) {
|
|
5
|
-
server.watcher.add("/app/**");
|
|
6
|
-
server.watcher.on("add", async () => {
|
|
7
|
-
await server.restart();
|
|
8
|
-
});
|
|
9
|
-
server.watcher.on("unlink", async () => {
|
|
10
|
-
await server.restart();
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
restartOnAddUnlink
|
|
17
|
-
};
|