UNPKG

actionhero

Version:

actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks

47 lines (36 loc) 2.53 kB
<section class="bs-docs-section"> <h1 id="overview" class="page-header">Learn More</h1> <p>ActionHero is a multi-transport Node.JS API Server with integrated cluster capabilities and delayed tasks.</p> <p>ActionHero was built from the ground up to include all the features you expect from a modern API framework. This includes all the features listed below and more. ActionHero also knows when to get out of the way to allow you to customize your stack to fit your needs.</p> </section> <section class="bs-docs-section"> <h1 id="servers" class="page-header">Servers</h1> <h2 id="web">Web</h2> <p><span class="label label-info"><a href="/docs/servers/#web">Web Server Docs</a></span></p> <p>ActionHero can act as a HTTP or HTTPS API server. With integrated routing, it is easy to create RESTful resources. ActionHero can also serve static files.</p> {% highlight bash %} curl "http://127.0.0.1:8080/api/" -d "action=actionsView" {% endhighlight %} <h2 id="web-socket">Web Socket</h2> <p><span class="label label-info"><a href="/docs/servers/#websocket">Websocket Server Docs</a></span></p> <p>ActionHero uses Primus to provided a robust and reliable nodejs websocket implementation. ActionHero web socket clients can fall back to long-polling and other transports to ensure they are connected. Primus allows you to choose the underlying websocket implementation of your choice.</p> {% highlight javascript %} var A = new ActionheroClient; A.connect(); A.action("actionsView", function(data){ console.log(data); }) {% endhighlight %} <h2 id="socket">Socket</h2> <p><span class="label label-info"><a href="/docs/servers/#socket">Socket Server Docs</a></span></p> <p>ActionHero ships with the ability to be a line TCP or TLS server. ActionHero clients can speak a wire protocol that sends lines of JSON. Actions can be processed asynchronously and in parallel. The API server and the built-in chat system provide all you need for a communication or game application.</p> {% highlight bash %} > telnet localhost 5000 Trying 127.0.0.1... Connected to localhost. {"welcome":"Hello! Welcome to the actionhero api"} > say myChatRoom hello {"ok"} {% endhighlight %} <h2>Your Own</h2> <p><span class="label label-info"><a href="/docs/core/#servers">Custom Server Docs</a></span></p> <p>Most importantly, ActionHero's modular server architecture allows you to define your own servers and protocols. Learn how in <a href="/docs/overview/">the ActionHero documentation</a>.</p> </section>