We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following results in a payload hola and not the json "hola".
hola
"hola"
import http from 'http'; import koa from 'koa'; import json from 'koa-json'; const app = new koa(); app.use(json()); app.use(ctx => ctx.body = 'hola'); http.createServer(app.callback()).listen(1234);
Current workaround:
app.use(async (ctx, next) => { await next(); if (typeof ctx.body === 'string') ctx.body = `"${ctx.body}"`; });
The text was updated successfully, but these errors were encountered:
why would you send a string JSON-encoded?
Sorry, something went wrong.
@jonathanong for consistency:
No branches or pull requests
The following results in a payload
hola
and not the json"hola"
.Current workaround:
The text was updated successfully, but these errors were encountered: