Skip to content

Commit

Permalink
Merge pull request #22 from ty-ras/issue/21-contextless-endpoints
Browse files Browse the repository at this point in the history
#21 Enabling support for contextless endpoints.
  • Loading branch information
stazz authored Feb 13, 2024
2 parents 56cae48 + 3547ee2 commit ed63b25
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ty-ras/server-koa",
"version": "2.2.1",
"version": "2.3.0",
"author": {
"name": "Stanislav Muhametsin",
"email": "[email protected]",
Expand Down Expand Up @@ -34,7 +34,7 @@
"koa": "^2.14.2"
},
"dependencies": {
"@ty-ras/server": "^2.2.1"
"@ty-ras/server": "^2.3.0"
},
"devDependencies": {
"@ava/get-port": "2.0.0",
Expand Down
3 changes: 1 addition & 2 deletions server/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file This file contains helper function to create Koa middleware callback.
*/

import type * as ep from "@ty-ras/endpoint";
import * as server from "@ty-ras/server";
import type * as koa from "koa";
import type * as context from "./context.types";
Expand All @@ -16,7 +15,7 @@ import * as internal from "./internal";
* @returns The Koa middleware which will serve the given endpoints.
*/
export const createMiddleware = <TStateInfo, TState>(
endpoints: ReadonlyArray<ep.AppEndpoint<context.ServerContext, TStateInfo>>,
endpoints: server.ServerEndpoints<context.ServerContext, TStateInfo>,
createState?: context.CreateState<TStateInfo>,
events?: server.ServerEventHandler<
server.GetContext<context.ServerContext>,
Expand Down
3 changes: 1 addition & 2 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file This file exposes function to create Node HTTP 1 or 2 server serving giving TyRAS {@link ep.AppEndpoint}s.
*/

import * as ep from "@ty-ras/endpoint";
import * as server from "@ty-ras/server";
import Koa from "koa";

Expand Down Expand Up @@ -37,7 +36,7 @@ export interface ServerCreationOptions<TStateInfo, TState> {
/**
* The TyRAS {@link ep.AppEndpoint}s to server via returned HTTP server.
*/
endpoints: ReadonlyArray<ep.AppEndpoint<ctx.ServerContext, TStateInfo>>;
endpoints: server.ServerEndpoints<ctx.ServerContext, TStateInfo>;

/**
* The callback to create endpoint-specific state objects.
Expand Down
8 changes: 4 additions & 4 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@
dependencies:
"@ty-ras/endpoint" "^2.0.0"

"@ty-ras/server@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@ty-ras/server/-/server-2.2.1.tgz#747995863d54ad828191e2cdb6f528231c24939b"
integrity sha512-Qy22YPpjcqrBP698d2Sm5LqmX39hq3aLuOngTRxKhD0kU2y4GooKgrMDCmaKkfteP/0fqoqZG4c20ukeTtPqcg==
"@ty-ras/server@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@ty-ras/server/-/server-2.3.0.tgz#f168669b29f777130823bf583341f83f0ade8ec0"
integrity sha512-0DhQqHHwyfDP2YJQhbxl+TAs4yDXKaBAVgs53+nCS0lr0M7Surc1MZ9AUeDQtcZJKc8FkWhUhUpt9aOQjZ89EA==
dependencies:
"@ty-ras/endpoint" "^2.0.0"

Expand Down

0 comments on commit ed63b25

Please sign in to comment.