core: experimental hot reload support

This commit is contained in:
undefined committed 2022-09-20 22:34:36 +08:00
1 parent 632ae27b88
commit fd7c9cbeb1
26 files changed
+429 -148

No files matched your search

+4 -5
View File
@@ -2,7 +2,7 @@ import { makeExecutableSchema } from '@graphql-tools/schema';
import { graphql, GraphQLSchema } from 'graphql';
import { resolvers, typeDefs } from 'graphql-scalars';
import * as bus from '../service/bus';
import { Handler, Route } from '../service/server';
import { Handler } from '../service/server';
const types: Record<string, Record<string, string>> = {};
const unions: Record<string, string> = {};
@@ -123,8 +123,7 @@ class ApiHandler extends Handler {
}
}
export function apply() {
Route('api', '/api', ApiHandler);
export const sideEffect = true;
export function apply(ctx) {
ctx.Route('api', '/api', ApiHandler);
}
global.Hydro.handler.api = apply;