Skip to content

Commit 40ed5b8

Browse files
committed
Added better readme
1 parent e4499bf commit 40ed5b8

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
11
# Gotham Node
2+
3+
This is a library that provides you with helper methods for interfacing with the microservices framework, [gotham](https://github.com/bytesonus/gotham).
4+
5+
## How to use:
6+
7+
There is a lot of flexibility provided by the library, in terms of connection options and encoding protocol options. However, in order to use the library, none of that is required.
8+
9+
In case you are planning to implement a custom connection option, you will find an example in `src/connection/unix-socket-connection.ts`.
10+
11+
For all other basic needs, you can get away without worrying about any of that.
12+
13+
### A piece of code is worth a thousand words
14+
15+
```js
16+
import GothamModule from "./src/gotham-node";
17+
18+
async function main() {
19+
let module = GothamModule.default("./path/to/gotham.sock");
20+
await module.initialize("module-name", "1.0.0");
21+
console.log("Initialized!");
22+
23+
await module.declareFunction("printHello", (args) => {
24+
console.log("Hello");
25+
Value::Null
26+
});
27+
28+
await module.call_function("module2.printHelloWorld");
29+
}
30+
31+
main()
32+
```
File renamed without changes.

src/gotham-node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
TriggerHookRequest,
99
GothamMessage
1010
} from './models/messages';
11-
import SocketConnection from './connection/socket-connection';
11+
import SocketConnection from './connection/unix-socket-connection';
1212

1313
export default class GothamModule {
1414

0 commit comments

Comments
 (0)