-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move Rpc.res to npm package * Downgrade rescript-schema * Vendore Express bindings * Vendor rescript-rest and use it for RPC client * Fix chains test
- Loading branch information
Showing
30 changed files
with
1,099 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Inspired by https://github.com/bloodyowl/rescript-express | ||
|
||
type app | ||
|
||
// "default" & seem to conflict a bit right now | ||
// https://github.com/rescript-lang/rescript-compiler/issues/5004 | ||
@module external makeCjs: unit => app = "express" | ||
@module("express") external make: unit => app = "default" | ||
|
||
type req | ||
type res | ||
|
||
type handler = (req, res) => unit | ||
type middleware = (req, res, unit => unit) => unit | ||
|
||
@module("express") external jsonMiddleware: unit => middleware = "json" | ||
|
||
@send external use: (app, middleware) => unit = "use" | ||
|
||
@send external get: (app, string, handler) => unit = "get" | ||
|
||
type server | ||
|
||
@send external listen: (app, int) => server = "listen" | ||
|
||
// res methods | ||
@send external sendStatus: (res, int) => res = "sendStatus" | ||
@send external set: (res, string, string) => unit = "set" | ||
@send external endWithData: (res, 'a) => res = "end" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.