Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 83 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/__tests__/parser-compat.tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-env jest */
import { Server } from "node:http";
import micro from "micro";

import createHandler from "../";
Expand All @@ -10,7 +10,9 @@ describe("Same query should give same output for different parsers", () => {
let response: { data: { [key in ParserKey]: unknown }; errors: any[] };
let keys: ParserKey[] = [];
beforeAll(async () => {
const service = micro(await createHandler({ version: "version" }));
const service = new Server(
micro(await createHandler({ version: "version" })),
);

const { url, close } = await listen(service);

Expand Down
13 changes: 7 additions & 6 deletions src/__tests__/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Server } from "node:http";
/* eslint-env jest */
import { Server } from "node:http";
import micro from "micro";

import createHandler from "../";
Expand Down Expand Up @@ -27,10 +26,12 @@ export function testGraphqlApi(
) {
const query = String.raw(strings, ...args);
test(query, async () => {
const service = micro(
await createHandler({
version: "test",
}),
const service = new Server(
micro(
await createHandler({
version: "test",
}),
),
);

const { url, close } = await listen(service);
Expand Down
17 changes: 10 additions & 7 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Server } from "node:http";
import { command, number, option, optional, run, string } from "cmd-ts";
import micro, { type RequestHandler } from "micro";
import serve, { type RequestHandler } from "micro";
import type { Options } from "./index";

export function cli({
Expand Down Expand Up @@ -45,14 +46,16 @@ export function cli({
}),
},
handler: async (args) => {
const server = micro(
await createHandler({
version,
sentryDsn: args.sentryDsn,
}),
const server = new Server(
serve(
await createHandler({
version,
sentryDsn: args.sentryDsn,
}),
),
);

console.log(`Starting graphql-rss-parser v${version}`);
console.log("Starting graphql-rss-parser v$version");
server.listen(args.port);
},
});
Expand Down
Loading