A simple, fun, fully asynchronous web socket server
npm install -g @bsgbryan/jyn
jyn
That's it. Really.
For command options, execute jyn --help
jyn is built on Mädūl. It bootstraps and invokes the madul specified by the action
property of the JSON web socket request, executes the method requested, and returns the results.
What does this look like in practice?
mkdir ~/jyn_test && cd ~/jyn_test
npm install -g wscat
jyn
echo 'const madul = { greet: ({ name }) => `Hello ${name}!` }\n' > ./casian.js
wscat -c ws:https://localhost:1138
{"action": "casian.greet", "name": "World"}
This should result in the response {"result": "Hello World!"}