The actionhero framework is one of the fastest ways to get started with a REST API - Routes, Versions, Testing and Translation tool are all included.
Actionhero's small footprint and stateful server options make it ideal for IOT applications where as much logic as possible is offloaded to the server.
Actionhero includes all the modern tools you need for a highly-available realtime applications. Actionhero can work in a cluster to handle all the clients you can throw at it.
Actionhero was built to serve the same APIs across multiple protocols. Do your games speak both HTTP and Websockets? Actionhero has got you covered.
# Generate a new Project
npx actionhero generate
npm install
npm run dev # <-- I automatically notice changes and restart, as well as compiling .ts files
# Use the actionhero CLI
(npx) actionhero generate-action --name my_action
(npx) actionhero generate-task --name my_task --queue default --frequency 0
# Test
npm test
# To deploy your app
npm run build
npm run start
import { Action, ParamsFrom } from "actionhero";
export class Greeting extends Action {
name = "greeting";
description = "I say hello";
inputs = {
firstName: { required: true },
};
outputExample = { message: "Hello, Evan!" };
async run({ params }: { params: ParamsFrom<Greeting> }) {
return { message: `Hello, ${params.firstName}` };
}
}
import { Task, task, ParamsFrom } from 'actionhero'
export class WelcomeEmailTask extends Task {
name = 'sendWelcomeEmail'
description = 'I send an email'
frequency = 0
queue = 'default'
inputs = {
email: { required: true },
};
async run (params: ParamsFrom<WelcomeEmailTask>) {
await api.sendEmail(params.email)
}
}
// to use it
await task.enqueue("sendWelcomeEmail", {email: 'evan@actionherojs.com'});
With Actionhero, you create Actions which can respond to any type of connection. They process incoming parameters and offer a response to the client. Actionhero takes care of routing and responding to each connection type for you.
View Sample
Background tasks are first-class in Actionhero. You can enqueue a task from anywhere in the application. Tasks can be recurring or single-run. The Actionhero task system is powered by Resque, so it is compatible with a number of other applications and frameworks.
View Sample
Actionhero uses Redis to store and share data. With first-class cache functions, decentralized communications, and distributed workers, you can be sure that your application is able to scale from 1 worker on one server, to as big of a cluster as you need.
View Sample
Actionhero ships with a robust router to make mapping HTTP requests to your actions a breeze.
View Sample
Actionhero makes API-First development easy by enforcing a strict separation of views and application logic and removing barriers to API creation. Versioning your actions is simple and integrates well with Agile or XP team workflows.
It is simple to deploy Actionhero with our included CLI tools. You can launch your server as a single instance or as part of a larger deployment cluster. Tools for 0-downtime deployments and robust monitoring and logging hooks make Actionhero a dream platform for your operations team.
The Actionhero API makes it simple to create a Actionhero (optionally) facilitates real-time communication not only from server-to-client, but also client-to-client! Actionhero's chat sub-system allows for streaming of both public and private messages between clients. Complete with middleware and extensions, you can create chat services, multi-player games, and more!
View Sample
Every server needs to serve files to its clients (even those that don't speak HTTP), and Actionhero is no exception. Configured to asynchronously stream file contents, Actionhero provides an robust file server which can live in parallel with your API, allowing for a fully featured server.
The Actionhero server is open source, under the Apache-2 license
Actionhero runs on Linux, OS X, and Windows
You always have access to the Actionhero team via Slack and Github
We provide support for corporate & nonprofit customers starting at a flat rate of $200/hr. Our services include:
We have packages appropriate for all company sizes. Contact us to learn more.
We provide support for corporate & nonprofit customers starting at a flat rate of $200/hr. Our services include:
We have packages appropriate for all company sizes. Contact us to learn more.
For larger customers in need of a support contract, we offer an enterprise plan including everything in the Premium plan plus: