Skip to content

Commit

Permalink
feat: add example package to show usage
Browse files Browse the repository at this point in the history
  • Loading branch information
BlairCurrey committed May 21, 2024
1 parent 198cf1b commit e3a64eb
Show file tree
Hide file tree
Showing 7 changed files with 910 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The middleware takes a configuration object with the following properties:

# More examples

In addition to these examples, see the implementations in [`./test/createKoaMiddleware.test.ts`](https://github.com/BlairCurrey/trpc-koa-adapter/blob/master/test/createKoaMiddleware.test.ts).
In addition to these examples, see `/example` and the implementations in [`/test/createKoaMiddleware.test.ts`](https://github.com/BlairCurrey/trpc-koa-adapter/blob/master/test/createKoaMiddleware.test.ts).

## Using the Context:

Expand Down
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
In seperate terminals:

Start the server:

pnpm server:start

Run the client to make requests:

pnpm client:start

Edit the server and client as needed to test different use-cases and restart.
27 changes: 27 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"client:start": "ts-node src/client.ts",
"server:start": "ts-node src/server.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@koa/bodyparser": "^5.0.0",
"@trpc/client": "^10.45.2",
"@trpc/server": "^ 10.45.2",
"koa": "^2.13.4",
"koa-bodyparser": "^4.4.1",
"trpc-koa-adapter": "1.2.1",
"zod": "^3.19.1"
},
"devDependencies": {
"@types/koa": "^2.13.5",
"@types/koa-bodyparser": "^4.3.12",
"ts-node": "^10.9.2"
}
}
Loading

0 comments on commit e3a64eb

Please sign in to comment.