yanir midler
yanir midler

Reputation: 2712

how to return xml using ctx in expressJS

How can i return xml using ctx from msw package?

now i using this code:

const endpointHandler = (req, res, ctx) => {
  const xml = `<test></test>`;

  return res(ctx.status(200), ctx.xml(xml));
};

but it's don't work

any help?

Upvotes: 0

Views: 96

Answers (1)

yanir midler
yanir midler

Reputation: 2712

ok i get it :

return res(ctx.xml(<test></test>));

Upvotes: 0

Related Questions