actionhero
Version:
actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks
19 lines (16 loc) • 408 B
text/typescript
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, response }) {
response.didCreate = await chatRoom.add(params.name);
}
}