In the video, I show how you can use my ReScript Rest library to create an HTTP server with Fastify, generate OpenAPI for it, and then consume it on the client in the most typesafe way. Talk about best practices, testing, and more.
This video will be interesting to proficient ReScript builders and TypeScript developers interested in alternative approaches. If you are familiar with trpc, ts-rest, Hono-rpc, or other rpc libraries, I think you will find the API shown in the video very interesting and flexible.
You can find all the used libraries pinned on my GitHub account 🙂
https://github.com/DZakh
Some links:
https://github.com/DZakh/rescript-rest
https://rescript-lang.org
https://fastify.dev
https://scalar.com
https://x.com/dzakh_dev
0:00 Introduction
2:50 Plan
6:00 Create ReScript App
7:50 Start building
13:45 Deep into rescript-rest
27:30 Server implementation
35:00 Custom Api Fetcher and more about variables
40:55 Add dummy logic
43:40 Some cool features
46:30 About code-splitting & tree-shaking
48:50 Access env variables in ReScript
54:00 Fancy demo
56:40 Coding
1:07:10 OpenAPI + fast-json-stringify
1:16:30 Testing
1:20:00 Wrapping up
Тэги:
#rescript #fastify #programming #rest #http #api #fetch #schema #environment #variables #coding