Skip to content

Commit

Permalink
#20 Enabling support for contextless endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
stazz committed Feb 13, 2024
1 parent 737cb81 commit 0b39e46
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-express",
"version": "2.1.1",
"version": "2.2.0",
"author": {
"name": "Stanislav Muhametsin",
"email": "[email protected]",
Expand Down Expand Up @@ -31,7 +31,7 @@
}
},
"dependencies": {
"@ty-ras/server": "^2.2.1"
"@ty-ras/server": "^2.3.0"
},
"peerDependencies": {
"express": "^4.18.2"
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 Express middleware callback.
*/

import * as ep from "@ty-ras/endpoint";
import * as server from "@ty-ras/server";
import type * as express from "express";
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 * as express from "express";
import type * as ctx from "./context.types";
Expand Down Expand Up @@ -34,7 +33,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 0b39e46

Please sign in to comment.