UNPKG

actionhero

Version:

The reusable, scalable, and quick node.js API server for stateless and stateful applications

19 lines (16 loc) 429 B
import { chatRoom, Action } from "./../index"; export class CreateChatRoom extends Action { constructor() { super(); this.name = "createChatRoom"; this.description = "I will create a chatroom with the given name"; this.inputs = { name: { required: true, }, }; } async run({ params }: { params: { name: string } }) { return { didCreate: await chatRoom.add(params.name) }; } }