@modern-js/server 1.3.1-beta.0 → 1.4.1

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/dist/js/modern/dev-tools/babel/register.js +1 -0
  3. package/dist/js/modern/dev-tools/dev-server-plugin.js +1 -2
  4. package/dist/js/modern/dev-tools/mock/getMockData.js +24 -1
  5. package/dist/js/modern/dev-tools/mock/index.js +1 -26
  6. package/dist/js/modern/dev-tools/socket-server.js +4 -2
  7. package/dist/js/modern/dev-tools/watcher/index.js +4 -7
  8. package/dist/js/modern/dev-tools/watcher/stats-cache.js +32 -20
  9. package/dist/js/modern/libs/context/context.js +6 -0
  10. package/dist/js/modern/libs/hook-api/route.js +6 -4
  11. package/dist/js/modern/libs/render/index.js +1 -0
  12. package/dist/js/modern/libs/render/reader.js +1 -2
  13. package/dist/js/modern/libs/render/ssr.js +7 -2
  14. package/dist/js/modern/libs/route/index.js +0 -1
  15. package/dist/js/modern/libs/route/matcher.js +15 -3
  16. package/dist/js/modern/libs/route/route.js +1 -0
  17. package/dist/js/modern/server/dev-server/dev-server.js +3 -0
  18. package/dist/js/modern/server/index.js +5 -4
  19. package/dist/js/modern/server/modern-server-split.js +1 -1
  20. package/dist/js/modern/server/modern-server.js +13 -34
  21. package/dist/js/modern/utils.js +39 -0
  22. package/dist/js/node/dev-tools/babel/register.js +1 -0
  23. package/dist/js/node/dev-tools/dev-server-plugin.js +1 -2
  24. package/dist/js/node/dev-tools/mock/getMockData.js +29 -2
  25. package/dist/js/node/dev-tools/mock/index.js +5 -26
  26. package/dist/js/node/dev-tools/socket-server.js +4 -2
  27. package/dist/js/node/dev-tools/watcher/index.js +7 -5
  28. package/dist/js/node/dev-tools/watcher/stats-cache.js +33 -20
  29. package/dist/js/node/libs/context/context.js +6 -0
  30. package/dist/js/node/libs/hook-api/route.js +6 -4
  31. package/dist/js/node/libs/render/index.js +1 -0
  32. package/dist/js/node/libs/render/reader.js +2 -1
  33. package/dist/js/node/libs/render/ssr.js +8 -2
  34. package/dist/js/node/libs/route/index.js +0 -1
  35. package/dist/js/node/libs/route/matcher.js +16 -3
  36. package/dist/js/node/libs/route/route.js +1 -0
  37. package/dist/js/node/server/dev-server/dev-server.js +3 -0
  38. package/dist/js/node/server/index.js +9 -6
  39. package/dist/js/node/server/modern-server-split.js +1 -1
  40. package/dist/js/node/server/modern-server.js +12 -33
  41. package/dist/js/node/utils.js +51 -2
  42. package/dist/types/dev-tools/mock/getMockData.d.ts +2 -1
  43. package/dist/types/dev-tools/socket-server.d.ts +1 -2
  44. package/dist/types/dev-tools/watcher/index.d.ts +2 -1
  45. package/dist/types/dev-tools/watcher/stats-cache.d.ts +3 -2
  46. package/dist/types/libs/context/context.d.ts +2 -0
  47. package/dist/types/libs/hook-api/route.d.ts +3 -2
  48. package/dist/types/libs/render/reader.d.ts +13 -0
  49. package/dist/types/libs/render/ssr.d.ts +1 -0
  50. package/dist/types/libs/route/matcher.d.ts +1 -1
  51. package/dist/types/libs/route/route.d.ts +1 -0
  52. package/dist/types/server/dev-server/dev-server-split.d.ts +3 -3
  53. package/dist/types/server/modern-server-split.d.ts +3 -3
  54. package/dist/types/server/modern-server.d.ts +1 -2
  55. package/dist/types/type.d.ts +6 -4
  56. package/dist/types/utils.d.ts +5 -1
  57. package/package.json +13 -12
  58. package/tests/context.test.ts +12 -1
  59. package/tests/dev.test.ts +306 -7
  60. package/tests/fixtures/mock/exist/config/mock/index.ts +11 -0
  61. package/tests/fixtures/mock/zero/config/mock/index.ts +1 -0
  62. package/tests/fixtures/pure/tsconfig.json +0 -1
  63. package/tests/fixtures/reader/index.ts +3 -0
  64. package/tests/fixtures/route-spec/dynamic.json +13 -0
  65. package/tests/fixtures/ssr/bundle.js +5 -0
  66. package/tests/fixtures/static-dir/bar.html +11 -0
  67. package/tests/fixtures/static-dir/baz/index.html +11 -0
  68. package/tests/fixtures/static-dir/foo/index.html +11 -0
  69. package/tests/fixtures/watch/a.ts +3 -0
  70. package/tests/fixtures/watch/index.ts +5 -0
  71. package/tests/fixtures/watch/stats.txt +1 -0
  72. package/tests/hook.test.ts +1 -1
  73. package/tests/render.test.ts +102 -0
  74. package/tests/route.test.ts +26 -3
  75. package/tests/utils.test.ts +35 -0
  76. package/tests/watcher.test.ts +6 -4
  77. package/src/constants.ts +0 -26
  78. package/src/dev-tools/babel/register.ts +0 -37
  79. package/src/dev-tools/dev-server-plugin.ts +0 -48
  80. package/src/dev-tools/https/global.d.ts +0 -3
  81. package/src/dev-tools/https/index.ts +0 -12
  82. package/src/dev-tools/launch-editor/index.ts +0 -29
  83. package/src/dev-tools/mock/getMockData.ts +0 -109
  84. package/src/dev-tools/mock/index.ts +0 -63
  85. package/src/dev-tools/socket-server.ts +0 -192
  86. package/src/dev-tools/watcher/dependency-tree.ts +0 -94
  87. package/src/dev-tools/watcher/index.ts +0 -81
  88. package/src/dev-tools/watcher/stats-cache.ts +0 -53
  89. package/src/index.ts +0 -16
  90. package/src/libs/context/context.ts +0 -176
  91. package/src/libs/context/index.ts +0 -7
  92. package/src/libs/hook-api/route.ts +0 -38
  93. package/src/libs/hook-api/template.ts +0 -53
  94. package/src/libs/metrics.ts +0 -15
  95. package/src/libs/proxy.ts +0 -85
  96. package/src/libs/render/cache/__tests__/cache.fun.test.ts +0 -94
  97. package/src/libs/render/cache/__tests__/cache.test.ts +0 -240
  98. package/src/libs/render/cache/__tests__/cacheable.ts +0 -44
  99. package/src/libs/render/cache/__tests__/error-configuration.ts +0 -34
  100. package/src/libs/render/cache/__tests__/matched-cache.ts +0 -88
  101. package/src/libs/render/cache/index.ts +0 -75
  102. package/src/libs/render/cache/page-caches/index.ts +0 -11
  103. package/src/libs/render/cache/page-caches/lru.ts +0 -38
  104. package/src/libs/render/cache/spr.ts +0 -301
  105. package/src/libs/render/cache/type.ts +0 -59
  106. package/src/libs/render/cache/util.ts +0 -97
  107. package/src/libs/render/index.ts +0 -78
  108. package/src/libs/render/modern/browser-list.ts +0 -7
  109. package/src/libs/render/modern/index.ts +0 -41
  110. package/src/libs/render/modern/module.d.ts +0 -4
  111. package/src/libs/render/reader.ts +0 -119
  112. package/src/libs/render/ssr.ts +0 -62
  113. package/src/libs/render/static.ts +0 -52
  114. package/src/libs/render/type.ts +0 -38
  115. package/src/libs/route/index.ts +0 -77
  116. package/src/libs/route/matcher.ts +0 -93
  117. package/src/libs/route/route.ts +0 -32
  118. package/src/libs/serve-file.ts +0 -34
  119. package/src/server/dev-server/dev-server-split.ts +0 -41
  120. package/src/server/dev-server/dev-server.ts +0 -300
  121. package/src/server/dev-server/index.ts +0 -2
  122. package/src/server/index.ts +0 -163
  123. package/src/server/modern-server-split.ts +0 -97
  124. package/src/server/modern-server.ts +0 -636
  125. package/src/type.ts +0 -88
  126. package/src/utils.ts +0 -79
@@ -1,119 +0,0 @@
1
- import { Buffer } from 'buffer';
2
- import { fs } from '@modern-js/utils';
3
- import LRU from 'lru-cache';
4
-
5
- const Byte = 1;
6
- const KB = 1024 * Byte;
7
- const MB = 1024 * KB;
8
-
9
- type FileCache = {
10
- content: Buffer;
11
- mtime: Date;
12
- };
13
-
14
- const getContentLength = (cache: FileCache) => cache.content.length;
15
-
16
- const createCacheItem = async (filepath: string, mtime: Date) => {
17
- const content = await fs.readFile(filepath);
18
-
19
- return {
20
- content,
21
- mtime,
22
- };
23
- };
24
- class LruReader {
25
- private readonly cache: LRU<string, FileCache>;
26
-
27
- // private timer?: NodeJS.Timeout;
28
-
29
- constructor() {
30
- this.cache = new LRU({
31
- max: 256 * MB,
32
- length: getContentLength,
33
- maxAge: 5 * 60 * 5000, // 60s
34
- });
35
- }
36
-
37
- public init() {
38
- // this.timeTask();
39
- }
40
-
41
- public close() {
42
- // if (this.timer) {
43
- // clearInterval(this.timer);
44
- // }
45
- }
46
-
47
- public async read(filepath: string) {
48
- if (this.cache.has(filepath)) {
49
- const { content } = this.cache.get(filepath)!;
50
-
51
- return { content };
52
- }
53
-
54
- if (!fs.existsSync(filepath)) {
55
- return null;
56
- }
57
-
58
- const stat = fs.statSync(filepath);
59
- if (stat.isDirectory()) {
60
- return null;
61
- }
62
-
63
- // if file more than 20 MB
64
- if (stat.size > 20 * MB) {
65
- return null;
66
- }
67
-
68
- const item = await createCacheItem(filepath, stat.mtime);
69
- this.cache.set(filepath, item);
70
- return item;
71
- }
72
-
73
- public update() {
74
- const { cache } = this;
75
- const files = cache.keys();
76
-
77
- for (const filepath of files) {
78
- if (!fs.existsSync(filepath)) {
79
- cache.del(filepath);
80
- }
81
-
82
- try {
83
- const item = cache.get(filepath)!;
84
- const stat = fs.statSync(filepath);
85
- const { mtime } = stat;
86
- // file is modify
87
- if (item.mtime < mtime) {
88
- cache.del(filepath);
89
- }
90
- } catch (e) {
91
- // for safe
92
- cache.del(filepath);
93
- }
94
- }
95
- }
96
-
97
- // private timeTask() {
98
- // this.timer = setInterval(() => this.update, 5 * 60 * 1000).unref();
99
- // }
100
- }
101
-
102
- const reader = new LruReader();
103
-
104
- export const readFile = async (filepath: string) => {
105
- const file = await reader.read(filepath);
106
- return file?.content;
107
- };
108
-
109
- export const updateFile = () => {
110
- reader.update();
111
- };
112
-
113
- export const init = () => {
114
- reader.init();
115
- };
116
-
117
- export const close = () => {
118
- reader.close();
119
- };
@@ -1,62 +0,0 @@
1
- import path from 'path';
2
- import { SERVER_RENDER_FUNCTION_NAME } from '@modern-js/utils';
3
- import mime from 'mime-types';
4
- import { ModernServerContext } from '../context';
5
- import { RenderResult, ServerHookRunner } from '../../type';
6
- import cache from './cache';
7
- import { SSRServerContext } from './type';
8
-
9
- export const render = async (
10
- ctx: ModernServerContext,
11
- renderOptions: {
12
- distDir: string;
13
- bundle: string;
14
- template: string;
15
- entryName: string;
16
- staticGenerate: boolean;
17
- },
18
- runner: ServerHookRunner,
19
- ): Promise<RenderResult> => {
20
- const { bundle, distDir, template, entryName, staticGenerate } =
21
- renderOptions;
22
- const bundleJS = path.join(distDir, bundle);
23
-
24
- const context: SSRServerContext = {
25
- request: {
26
- params: ctx.params,
27
- pathname: ctx.path,
28
- query: ctx.query as Record<string, string>,
29
- headers: ctx.headers,
30
- cookie: ctx.headers.cookie,
31
- },
32
- redirection: {},
33
- template,
34
- entryName,
35
- distDir,
36
- staticGenerate,
37
- logger: ctx.logger,
38
- metrics: ctx.metrics,
39
- };
40
-
41
- runner.extendSSRContext(context);
42
-
43
- const serverRender = require(bundleJS)[SERVER_RENDER_FUNCTION_NAME];
44
-
45
- const html = await cache(serverRender, ctx)(context);
46
-
47
- const { url, status = 302 } = context.redirection;
48
-
49
- if (url) {
50
- return {
51
- content: url,
52
- contentType: '',
53
- statusCode: status,
54
- redirect: true,
55
- };
56
- }
57
-
58
- return {
59
- content: html,
60
- contentType: mime.contentType('html') as string,
61
- };
62
- };
@@ -1,52 +0,0 @@
1
- import path from 'path';
2
- import mime from 'mime-types';
3
- import { RenderResult } from '../../type';
4
- import { ModernServerContext } from '../context';
5
- import { readFile } from './reader';
6
-
7
- export async function handleDirectory(
8
- ctx: ModernServerContext,
9
- entryPath: string,
10
- urlPath: string,
11
- ): Promise<RenderResult | null> {
12
- const { path: pathname } = ctx;
13
- const filepath = path.join(entryPath, trimLeft(pathname, urlPath));
14
-
15
- // If can match accurately, always return the one that matches accurately
16
- let content = await readFile(filepath);
17
- let contentType = mime.contentType(path.extname(filepath) || '');
18
-
19
- // automatic addressing
20
- if (!content) {
21
- if (pathname.endsWith('/')) {
22
- content = await readFile(`${filepath}index.html`);
23
- } else if (!pathname.includes('.')) {
24
- content = await readFile(`${filepath}.html`);
25
- if (!content) {
26
- content = await readFile(`${filepath}/index.html`);
27
- }
28
- }
29
-
30
- // set content-type as html
31
- if (content) {
32
- contentType = mime.contentType('html');
33
- }
34
- }
35
-
36
- if (!content) {
37
- return null;
38
- }
39
-
40
- return {
41
- content,
42
- contentType: contentType || '',
43
- };
44
- }
45
-
46
- const trimLeft = (str: string, prefix: string): string => {
47
- if (str.startsWith(prefix)) {
48
- return str.substring(prefix.length);
49
- }
50
-
51
- return str;
52
- };
@@ -1,38 +0,0 @@
1
- import { BaseSSRServerContext } from '@modern-js/types/server';
2
-
3
- type MetaKeyMap = {
4
- header?: string[];
5
- query?: string[];
6
- };
7
- type MetaKeyMatch = {
8
- header?: MatchMap;
9
- query?: MatchMap;
10
- };
11
- type MatchMap = Record<string, Record<string, string>>;
12
-
13
- export type CacheConfig = {
14
- interval: number;
15
- staleLimit: number | boolean;
16
- level: number;
17
- includes?: MetaKeyMap | null;
18
- excludes?: MetaKeyMap | null;
19
- matches?: MetaKeyMatch | null;
20
- };
21
-
22
- export enum RenderLevel {
23
- CLIENT_RENDER,
24
- SERVER_PREFETCH,
25
- SERVER_RENDER,
26
- }
27
-
28
- export type SSRServerContext = BaseSSRServerContext & {
29
- cacheConfig?: CacheConfig;
30
- staticGenerate?: boolean;
31
- };
32
-
33
- export type ModernSSRReactComponent = React.ComponentType<any> & {
34
- init: (context: SSRServerContext) => Promise<void>;
35
- prefetch: (context: SSRServerContext) => Promise<Record<string, any>>;
36
- };
37
-
38
- export type RenderFunction = (context: SSRServerContext) => Promise<string>;
@@ -1,77 +0,0 @@
1
- import { RouteMatcher } from './matcher';
2
- import { ModernRoute, ModernRouteInterface } from './route';
3
-
4
- export class RouteMatchManager {
5
- public matchers: RouteMatcher[];
6
-
7
- private specs: ModernRouteInterface[] = [];
8
-
9
- constructor() {
10
- this.matchers = [];
11
- }
12
-
13
- // get all routes matches pathname
14
- private filter(pathname: string) {
15
- return this.matchers.reduce((matches, matcher) => {
16
- // 非网关来的,或网关匹配上之后,内部再进行一次自己的匹配
17
- if (matcher.matchUrlPath(pathname)) {
18
- matches.push(matcher);
19
- }
20
- return matches;
21
- }, [] as RouteMatcher[]);
22
- }
23
-
24
- // get best match from a set of matches
25
- private best(pathname: string, matches: RouteMatcher[]) {
26
- let best: RouteMatcher | undefined;
27
- let matchedLen = 0;
28
-
29
- for (const match of matches) {
30
- const len = match.matchLength(pathname);
31
-
32
- if (len === null) {
33
- continue;
34
- }
35
-
36
- if (len > matchedLen) {
37
- best = match;
38
- matchedLen = len;
39
- }
40
- }
41
-
42
- return best;
43
- }
44
-
45
- // reset routes matcher
46
- public reset(specs: ModernRouteInterface[]) {
47
- this.specs = specs;
48
- const matchers = specs.reduce((ms, spec) => {
49
- ms.push(new RouteMatcher(spec));
50
- return ms;
51
- }, [] as RouteMatcher[]);
52
-
53
- this.matchers = matchers;
54
- }
55
-
56
- // get best match from all matcher in manager
57
- public match(pathname: string) {
58
- const matches = this.filter(pathname);
59
- const best = this.best(pathname, matches);
60
- return best;
61
- }
62
-
63
- public matchEntry(entryname: string) {
64
- return this.matchers.find(matcher => matcher.matchEntry(entryname));
65
- }
66
-
67
- public getBundles() {
68
- const bundles = this.specs
69
- .filter(route => route.isSSR)
70
- .map(route => route.bundle);
71
-
72
- return bundles;
73
- }
74
- }
75
-
76
- export type { ModernRouteInterface, ModernRoute };
77
- export { RouteMatcher };
@@ -1,93 +0,0 @@
1
- import { removeTailSlash } from '@modern-js/utils';
2
- import {
3
- MatchFunction,
4
- MatchResult,
5
- match,
6
- pathToRegexp,
7
- } from 'path-to-regexp';
8
- import { ModernRoute, ModernRouteInterface } from './route';
9
-
10
- // eslint-disable-next-line no-useless-escape
11
- const regCharsDetector = /[^a-zA-Z\-_0-9\/\.]/;
12
- export class RouteMatcher {
13
- public spec: ModernRouteInterface;
14
-
15
- public urlPath: string = '';
16
-
17
- public urlMatcher?: MatchFunction;
18
-
19
- public urlReg?: RegExp;
20
-
21
- constructor(spec: ModernRouteInterface) {
22
- this.spec = spec;
23
- this.setupUrlPath();
24
- }
25
-
26
- // generate modern route object
27
- public generate() {
28
- return new ModernRoute(this.spec);
29
- }
30
-
31
- public parseURLParams(pathname: string) {
32
- if (!this.urlMatcher) {
33
- return {};
34
- } else {
35
- const matchResult = this.urlMatcher(pathname);
36
-
37
- return (matchResult as MatchResult<Record<string, string>>).params;
38
- }
39
- }
40
-
41
- // get match url length
42
- public matchLength(pathname: string): number | null {
43
- if (!this.urlReg) {
44
- return this.urlPath.length;
45
- } else {
46
- const result = this.urlReg.exec(pathname);
47
- return result?.[0]?.length || null;
48
- }
49
- }
50
-
51
- // if match url path
52
- public matchUrlPath(requestUrl: string): boolean {
53
- const urlWithoutSlash =
54
- requestUrl.endsWith('/') && requestUrl !== '/'
55
- ? requestUrl.slice(0, -1)
56
- : requestUrl;
57
-
58
- if (this.urlMatcher) {
59
- return Boolean(this.urlMatcher(urlWithoutSlash));
60
- } else {
61
- if (urlWithoutSlash.startsWith(this.urlPath)) {
62
- // avoid /abcd match /a
63
- if (
64
- this.urlPath !== '/' &&
65
- urlWithoutSlash.length > this.urlPath.length &&
66
- !urlWithoutSlash.startsWith(`${this.urlPath}/`)
67
- ) {
68
- return false;
69
- }
70
-
71
- return true;
72
- }
73
-
74
- return false;
75
- }
76
- }
77
-
78
- public matchEntry(entryName: string): boolean {
79
- return this.spec.entryName === entryName;
80
- }
81
-
82
- // compiler urlPath to regexp if necessary
83
- private setupUrlPath() {
84
- const { urlPath } = this.spec;
85
- this.urlPath = urlPath === '/' ? urlPath : removeTailSlash(urlPath);
86
-
87
- const useReg = regCharsDetector.test(urlPath);
88
- if (useReg) {
89
- this.urlMatcher = match(urlPath, { decode: decodeURIComponent });
90
- this.urlReg = pathToRegexp(urlPath);
91
- }
92
- }
93
- }
@@ -1,32 +0,0 @@
1
- import { ServerRoute as ModernRouteInterface } from '@modern-js/types';
2
-
3
- export type { ModernRouteInterface };
4
-
5
- export class ModernRoute implements ModernRouteInterface {
6
- public entryName: string;
7
-
8
- public urlPath: string;
9
-
10
- public entryPath: string;
11
-
12
- public bundle: string;
13
-
14
- public isApi: boolean;
15
-
16
- public isSSR: boolean;
17
-
18
- public isSPA: boolean;
19
-
20
- public enableModernMode?: boolean;
21
-
22
- constructor(routeSpec: ModernRouteInterface) {
23
- this.entryName = routeSpec.entryName || '';
24
- this.urlPath = routeSpec.urlPath;
25
- this.entryPath = routeSpec.entryPath || '';
26
- this.isSSR = routeSpec.isSSR || false;
27
- this.isSPA = routeSpec.isSPA || false;
28
- this.isApi = routeSpec.isApi || false;
29
- this.bundle = routeSpec.bundle || '';
30
- this.enableModernMode = routeSpec.enableModernMode ?? false;
31
- }
32
- }
@@ -1,34 +0,0 @@
1
- // Todo 看看是不是能 fork 一份,即使命中也返回
2
- import serve from 'serve-static';
3
- import { isString, isRegExp } from '@modern-js/utils';
4
- import { NextFunction } from '../type';
5
- import { ModernServerContext } from './context';
6
-
7
- type Rule = {
8
- path: string | RegExp;
9
- target: string;
10
- };
11
-
12
- export const createStaticFileHandler =
13
- (rules: Rule[]) =>
14
- // eslint-disable-next-line consistent-return
15
- async (context: ModernServerContext, next: NextFunction) => {
16
- const { url: requestUrl, req, res } = context;
17
-
18
- const hitRule = rules.find(item => {
19
- if (isString(item.path) && requestUrl.startsWith(item.path)) {
20
- return true;
21
- } else if (isRegExp(item.path) && item.path.test(requestUrl)) {
22
- return true;
23
- }
24
- return false;
25
- });
26
-
27
- if (hitRule) {
28
- serve(hitRule.target)(req, res, () => {
29
- next();
30
- });
31
- } else {
32
- return next();
33
- }
34
- };
@@ -1,41 +0,0 @@
1
- import type { APIServerStartInput } from '@modern-js/server-plugin';
2
- import { mergeExtension } from '../../utils';
3
- import { ModernRouteInterface } from '../../libs/route';
4
- import { ApiServerMode } from '../../constants';
5
- import { ModernDevServer } from './dev-server';
6
-
7
- export class ModernSSRDevServer extends ModernDevServer {
8
- protected prepareAPIHandler(
9
- _m: ApiServerMode,
10
- _: APIServerStartInput['config'],
11
- ) {
12
- return null as any;
13
- }
14
-
15
- protected async prepareWebHandler(
16
- extension: ReturnType<typeof mergeExtension>,
17
- ) {
18
- return super.prepareWebHandler(extension);
19
- }
20
-
21
- protected filterRoutes(routes: ModernRouteInterface[]) {
22
- return routes.filter(route => route.entryName);
23
- }
24
- }
25
-
26
- export class ModernAPIDevServer extends ModernDevServer {
27
- protected async prepareAPIHandler(
28
- mode: ApiServerMode,
29
- extension: APIServerStartInput['config'],
30
- ) {
31
- return super.prepareAPIHandler(mode, extension);
32
- }
33
-
34
- protected filterRoutes(routes: ModernRouteInterface[]) {
35
- return routes.filter(route => route.isApi);
36
- }
37
-
38
- protected async preServerInit() {
39
- // noop
40
- }
41
- }