This Repository hosts two middleware component written in Ruby and Node.js.
このリポジトリは、Node.jsとRubyでプログラムされた2ミドルウェアが含まれています。
此存儲庫包含兩個使用Node.js和Ruby編寫的中間件。
This version uses RabbitMQ as Message Broker.
このバージョンは、Message Broker として RabbitMQ を使用しています。
此版本使用 RabbitMQ 作為Message Broker。
Middleware that execute tasks.
タスク実行のミドルウェア。
執行任務的中間件。
Middleware that act as REST API.
REST APIのミドルウェア。
REST API中間件。
- Ruby > 2.3.0 w/ Bundler
- Node.js 6.3.1 w/ npm (ES6/ECMAScript 6/ES2015 サポートが必要です) (ECMAScript 6 必要)
- RabbitMQ
- A web browser that support modern web technologies. (Google Chrome / Chromium / Firefox 推奨) (建議使用 Google Chomre / Chromium / Firefox)
- Linux (M$ Windows から残念です、申し訳ございません) (不支援 M$ Windows)
To specify a remote RabbitMQ, prepend environment variable AMQP_URI="amqp://your.rabbitmq.tld"
to ruby index.rb
and node index.js
, where your.rabbitmq.tld
is the IP or domain name to your RabbitMQ Instance.
To specify an alternative port of the API, prepend environment variable like PORT=3001
to node index.js
, where 3001
is the desired port number
To use the web UI with alternative port of API, prepend environment variable like APIPORT=3001
to node bin/www
, where 3001
is the desired port number
- Clone the Repository
- Open 3 terminal windows
- Terminal 1
cd node
thennpm install
finallynode index.js
- Terminal 2
cd ruby
thenbundler install
finallyruby index.rb
- Terminal 3
cd node-webui
thennpm install
finallynode bin/www
- Open a web browser, navigate to
http://127.0.0.1:3000/
and try! (The web UI is quite basic, so no Documentations) - Use any Web Browser, navigate to
http://127.0.0.1:3000/history
, you will see history of messages, with response - To reset the environment, either navigate to
http://127.0.0.1:3001/clear
or just restart the API process. - To exit, Strike CTRL+C TWICE
If you just be simple, use any REST Client, send a JSON, with following payload, to http://127.0.0.1:3001/send
{
"task": "", // echo, rev, hash, revhash, hello. All other tasks will be dropped by the backend dyno.
"payload": "Any String"
}
- jRuby Version? (Migrate to March Hare)
- REST API Server in other programming language?
- All Chinese (Traditional Script) and Japanese descriptions in this document are Machine-Translated Results. While Japanese results are interpreted afterwards, quality of Chinese descriptions are not assured.