Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seia-soto/s2c-example
A project to serve consistent type from the server to the client.
https://github.com/seia-soto/s2c-example
Last synced: 19 days ago
JSON representation
A project to serve consistent type from the server to the client.
- Host: GitHub
- URL: https://github.com/seia-soto/s2c-example
- Owner: seia-soto
- License: mit
- Created: 2023-01-06T17:51:03.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T17:52:17.000Z (about 2 years ago)
- Last Synced: 2024-11-05T16:57:48.243Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fully typed Server-to-Client API
A project to serve consistent type from the server to the client.
- pnpm workspace
- swc
- typescript
- fetch
- fastify
- typebox# Packages
## `browser`
A browser-side API to communicate with the server fully typed.
```typescript
import * as browser from 'browser';const fetcher = browser.createFetcher();
const response = await fetcher('GET /user');
```## `server`
A fastify based server schema-validation enabled by consistent type library in workspace.
Run the following script to execute server with swagger ui (at `:8080/`).
```
cd packages/server && pnpm -w build && pnpm start
```## `types`
A consistent type library.
See `server` code and `browser` code to the use of this library.