Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
nodejs: Koa, forma en pug da indefinido

tengo un formulario en pug con solo una entrada

 form(action="/" method="POST") label Enter URL to shorten br input(name="url" type="url") button(type="submit") Submit

Uso koa-pug para obtener la entrada.

 async function handleForm (ctx) { console.log(ctx.request.body); }

Sin embargo, esto registra undefined

También uso koa-body como analizador de cuerpo.

 app.use(body());
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

En su formulario, está llamando a su backend koa con un método POST . Entonces, para obtener el cuerpo, necesitas usar algo como co-body ,

 ... const parse = require('co-body'); ... async function handleForm (ctx) { let body = await parse(ctx); console.log(body); }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!