|
|
|
|
|
by hamasho
722 days ago
|
|
Yet another JS framework, and it looks great. I've only skimmed the doc, but I already like its simplicity. But I have a mixed opinion on the big Context object. It may help to write less verbose code, but it can also cause OOP's antipattern God Object[1], even though the context is more of a namespace rather than a big object. // Not
app.get('/hello', (c) => { return c.json({ greet: `Hello ${c.req.params('id')}`)
// But
import { jsonResponse } from 'library'
app.get('/hello', (req) => { return jsonResponse({ greet: `Hello ${req.params('id')}`)
[1] https://www.wikiwand.com/en/God_objectFix: format |
|