T10 Postman · Lesson 1
Games: Requests in Postman
Choose the right option, fill in the blanks, write small pieces of code and fix broken ones. Code runs in a safe box inside this page.
Solved 0 of 45 items in this lesson.
1 / 23
This program runs a collection against the gauges server (server.js: boiler 95, pump 40; GET /gauges, GET /gauges/:name, POST /gauges). What does it print?
cat > app.js <<'END'
const newman = require("newman");
const app = require("./server");
const collection = { info: { name: "Engine Hall gauges" }, item: [
{ name: "list gauges", request: "http://localhost:3000/gauges" },
] };
const server = app.listen(3000, () => {
newman.run({ collection })
.on("request", (err, args) => console.log(args.item.name, "|", args.response.code, args.response.text()))
.on("done", () => server.close());
});
END
node app.js