Initialisation
Added the packages and files for the backend server
This commit is contained in:
27
node_modules/@apollo/server/dist/esm/standalone/index.d.ts
generated
vendored
Normal file
27
node_modules/@apollo/server/dist/esm/standalone/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import type { WithRequired } from '@apollo/utils.withrequired';
|
||||
import { type IncomingMessage, type ServerResponse } from 'http';
|
||||
import type { ListenOptions } from 'net';
|
||||
import type { ApolloServer } from '../ApolloServer.js';
|
||||
import type { BaseContext, ContextFunction } from '../externalTypes/index.js';
|
||||
export interface StandaloneServerContextFunctionArgument {
|
||||
req: IncomingMessage;
|
||||
res: ServerResponse;
|
||||
}
|
||||
export interface StartStandaloneServerOptions<TContext extends BaseContext> {
|
||||
context?: ContextFunction<[
|
||||
StandaloneServerContextFunctionArgument
|
||||
], TContext>;
|
||||
}
|
||||
export declare function startStandaloneServer(server: ApolloServer<BaseContext>, options?: StartStandaloneServerOptions<BaseContext> & {
|
||||
listen?: ListenOptions;
|
||||
}): Promise<{
|
||||
url: string;
|
||||
}>;
|
||||
export declare function startStandaloneServer<TContext extends BaseContext>(server: ApolloServer<TContext>, options: WithRequired<StartStandaloneServerOptions<TContext>, 'context'> & {
|
||||
listen?: ListenOptions;
|
||||
}): Promise<{
|
||||
url: string;
|
||||
}>;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@apollo/server/dist/esm/standalone/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@apollo/server/dist/esm/standalone/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/standalone/index.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAa,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAY9E,MAAM,WAAW,uCAAuC;IACtD,GAAG,EAAE,eAAe,CAAC;IACrB,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B,CAAC,QAAQ,SAAS,WAAW;IACxE,OAAO,CAAC,EAAE,eAAe,CACvB;QAAC,uCAAuC;KAAC,EACzC,QAAQ,CACT,CAAC;CACH;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC,EACjC,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,GAAG;IACpD,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC5B,wBAAsB,qBAAqB,CAAC,QAAQ,SAAS,WAAW,EACtE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC9B,OAAO,EAAE,YAAY,CAAC,4BAA4B,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,GAAG;IACzE,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,GACA,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC"}
|
||||
20
node_modules/@apollo/server/dist/esm/standalone/index.js
generated
vendored
Normal file
20
node_modules/@apollo/server/dist/esm/standalone/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import cors from 'cors';
|
||||
import express from 'express';
|
||||
import http from 'http';
|
||||
import { expressMiddleware } from '../express4/index.js';
|
||||
import { ApolloServerPluginDrainHttpServer } from '../plugin/drainHttpServer/index.js';
|
||||
import { urlForHttpServer } from '../utils/urlForHttpServer.js';
|
||||
export async function startStandaloneServer(server, options) {
|
||||
const app = express();
|
||||
const httpServer = http.createServer(app);
|
||||
server.addPlugin(ApolloServerPluginDrainHttpServer({ httpServer: httpServer }));
|
||||
await server.start();
|
||||
const context = options?.context ?? (async () => ({}));
|
||||
app.use(cors(), express.json({ limit: '50mb' }), expressMiddleware(server, { context }));
|
||||
const listenOptions = options?.listen ?? { port: 4000 };
|
||||
await new Promise((resolve) => {
|
||||
httpServer.listen(listenOptions, resolve);
|
||||
});
|
||||
return { url: urlForHttpServer(httpServer) };
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@apollo/server/dist/esm/standalone/index.js.map
generated
vendored
Normal file
1
node_modules/@apollo/server/dist/esm/standalone/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/standalone/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAmD,MAAM,MAAM,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAkChE,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAA8B,EAC9B,OAA6E;IAE7E,MAAM,GAAG,GAAoB,OAAO,EAAE,CAAC;IACvC,MAAM,UAAU,GAAgB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAEvD,MAAM,CAAC,SAAS,CACd,iCAAiC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAC9D,CAAC;IAEF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAa,CAAC,CAAC;IACnE,GAAG,C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