1602 / 1602/compound

custom respondToformat

Offen
#584 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
1.6k
Forks
179
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I wanted to add custom respondto format for handling msgpack requests. I thought I could write

c.respondTo (format) ->
format.msgpack ->
c.send buffer.toJSON()

The above code didn't work. Is there any support for responding to custom formats?

Thanks
-Kesav

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Look at the respondTo method in the compound framework's source code, likely in a controller or response handling module. Understand how existing formats like JSON or HTML are registered and dispatched. Adding a new format involves extending the format registry and defining the serialization logic. Test by creating a controller action that uses the new msgpack format.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.