Skip to content

Commit

Permalink
Merge pull request #18 from ty-ras/issue/17-contextless-endpoints
Browse files Browse the repository at this point in the history
#17 Enabling support for contextless endpoints.
  • Loading branch information
stazz authored Feb 13, 2024
2 parents 8827610 + 0ff94ff commit f944b9f
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-fastify",
"version": "2.0.1",
"version": "2.1.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": {
"fastify": "^4.21.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 Fastify middleware callback.
*/

import * as ep from "@ty-ras/endpoint";
import * as protocol from "@ty-ras/protocol";
import * as server from "@ty-ras/server";
import type * as fastify from "fastify";
Expand All @@ -23,7 +22,7 @@ export const createMiddleware = <
TStateInfo,
TState,
>(
endpoints: ReadonlyArray<ep.AppEndpoint<TServerContext, TStateInfo>>,
endpoints: server.ServerEndpoints<TServerContext, TStateInfo>,
createState?: context.CreateState<TStateInfo>,
events?: server.ServerEventHandler<server.GetContext<TServerContext>, TState>,
): FastifyRouteHandler<TServerContext> => {
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 fastify from "fastify";
import type * as ctx from "./context.types";
Expand Down Expand Up @@ -171,7 +170,7 @@ export interface ServerCreationOptions<
/**
* The TyRAS {@link ep.AppEndpoint}s to server via returned HTTP server.
*/
endpoints: ReadonlyArray<ep.AppEndpoint<TServerContext, TStateInfo>>;
endpoints: server.ServerEndpoints<TServerContext, 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 @@ -471,10 +471,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 f944b9f

Please sign in to comment.