RPC work
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
"dependencies": {
|
||||
"@effect/platform": "^0.90.8",
|
||||
"@effect/platform-bun": "^0.79.0",
|
||||
"@website/common": "workspace:*",
|
||||
"effect": "^3.17.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ import { FileSystem, HttpMiddleware, HttpRouter, HttpServer, HttpServerRequest,
|
||||
import { Duration, Effect, flow } from "effect"
|
||||
|
||||
|
||||
const router = HttpRouter.empty.pipe(
|
||||
)
|
||||
const router = HttpRouter.empty
|
||||
|
||||
export const HttpAppDevelopment = router.pipe(
|
||||
HttpServer.serve(flow(
|
||||
|
||||
8
packages/server/src/webrpc/WebRpcLive.ts
Normal file
8
packages/server/src/webrpc/WebRpcLive.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Layer } from "effect"
|
||||
import * as WebRpcTestLive from "./WebRpcTestLive"
|
||||
import type { WebRpc } from "@website/common/webrpc"
|
||||
|
||||
|
||||
export const WebRpcLive = Layer.mergeAll(
|
||||
WebRpcTestLive.WebRpcTestLive,
|
||||
) satisfies ReturnType<typeof WebRpc.WebRpc.toLayer>
|
||||
9
packages/server/src/webrpc/WebRpcTestLive.ts
Normal file
9
packages/server/src/webrpc/WebRpcTestLive.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { WebRpcTest } from "@website/common/webrpc"
|
||||
import { Effect, Layer } from "effect"
|
||||
|
||||
|
||||
export const PingV1Live = WebRpcTest.WebRpcTest.toLayerHandler("Test.PingV1", Effect.succeed(() => Effect.succeed("pong" as const)))
|
||||
|
||||
export const WebRpcTestLive = Layer.mergeAll(
|
||||
PingV1Live,
|
||||
) satisfies ReturnType<typeof WebRpcTest.WebRpcTest.toLayer>
|
||||
2
packages/server/src/webrpc/index.ts
Normal file
2
packages/server/src/webrpc/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * as WebRpcLive from "./WebRpcLive"
|
||||
export * as WebRpcTestLive from "./WebRpcTestLive"
|
||||
@@ -23,6 +23,10 @@
|
||||
// Some stricter flags (disabled by default)
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noPropertyAccessFromIndexSignature": false
|
||||
"noPropertyAccessFromIndexSignature": false,
|
||||
|
||||
"plugins": [
|
||||
{ "name": "@effect/language-service" }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user