Open hota1024 opened 1 year ago
express
ActivityActivityControllable#emit(body: ActivityEvent): Promise<void>
ActivityControllable#crc(): CrcResponse
/* Twict */ const activity = new Activity('{LABEL}', { /* options */ }) activity.onFavoriteEvent(() => /* ... */) /* express */ const app = express() app.get('/', (req, res) => { const crcToken = req.query.crc_token if (typeof crcToken === 'string') { res.send(activity.crc()) // Activity#crc(): CrcResponse } else { res.status(400).send('crc_token missing from request.') } }) app.post('/', ({ body }) => activity.emit(body)) // Activity#emit(body: ActivityEvent): Promise<void>
I am not very experienced in TypeScript/JavaScript patterns but grammY, a Telegram bot framework, uses adapters.
See this https://github.com/grammyjs/grammY/blob/main/src/convenience/frameworks.node.ts
🎏 Goals
express
package💡 Ideas
The
ActivityActivityControllable#emit(body: ActivityEvent): Promise<void>
andActivityControllable#crc(): CrcResponse
methods